summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2018-01-09 02:02:03 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2018-01-09 17:07:22 +0000
commit182bfa0a9f0eb804408dddaf714e6fde1483730d (patch)
tree69e2a65b73d18601a49b98854158908d27a7850e
parent1777040cc5cefcb24287505f04af250fc7da4840 (diff)
downloadapk-tools-182bfa0a9f0eb804408dddaf714e6fde1483730d.tar.bz2
apk-tools-182bfa0a9f0eb804408dddaf714e6fde1483730d.tar.xz
apk: properly error out if an unknown command is requested
-rw-r--r--src/apk.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/apk.c b/src/apk.c
index 229dce5..6e5641d 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -579,7 +579,11 @@ int main(int argc, char **argv)
}
if (applet == NULL) {
- r = usage(NULL);
+ if (argc > 1) {
+ r = 1;
+ apk_error("'%s' is not an apk command. See 'apk --help'.", argv[1]);
+ } else
+ r = usage(NULL);
goto err;
}