From a512da2592dde978e899fa95e58cd94dea2829b9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 3 Jun 2016 09:08:55 -0400 Subject: [PATCH 1/2] Recommend a shell script wrapper for passing arguments This has come up as a question, so document it. --- doc/flatpak-builder.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/flatpak-builder.xml b/doc/flatpak-builder.xml index 3c8f91c8..9e397eb5 100644 --- a/doc/flatpak-builder.xml +++ b/doc/flatpak-builder.xml @@ -132,7 +132,7 @@ (string) - The filename or path to the main binary of the application. + The filename or path to the main binary of the application. Note that this is really just a single file, not a commandline. If you want to pass arguments, install a shell script wrapper and use that as the command. (boolean) From 6d1837ce4bae2ea3de0d1236a7a9d541f2327127 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 3 Jun 2016 09:22:21 -0400 Subject: [PATCH 2/2] Make an error message more helpful When we see somebody trying to use a command with spaces, we should be helpful and point out how to do what they want to do. --- builder/builder-manifest.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/builder/builder-manifest.c b/builder/builder-manifest.c index 0aa5d011..34dd4cb2 100644 --- a/builder/builder-manifest.c +++ b/builder/builder-manifest.c @@ -1632,8 +1632,14 @@ builder_manifest_finish (BuilderManifest *self, if (!g_file_query_exists (bin_command, NULL)) { + const char *help = ""; + + if (strchr (self->command, ' ')) + help = ". Use a shell wrapper for passing arguments"; + g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, - "Command '%s' not found", self->command); + "Command '%s' not found%s", self->command, help); + return FALSE; } }