From c90fcba12606e6a66dd4f947fa921bf1c72fc744 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Fri, 19 Nov 2010 14:21:55 -0300 Subject: [PATCH] qpkg/qpkg.c (main): show usage if there are no arguments or any options --- qpkg/qpkg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qpkg/qpkg.c b/qpkg/qpkg.c index 76ec13e..2b6120f 100644 --- a/qpkg/qpkg.c +++ b/qpkg/qpkg.c @@ -111,9 +111,13 @@ int main(int argc, char **argv) { int arg; + if (argc == 1) + usage(*argv); packages = make_tree(comp_id); versions = make_tree(comp_id); for (arg = 1; arg != argc; arg++) { + if (*argv[arg] == '-') + usage(*argv); if (!strcmp(argv[arg], "list")) { switch (argc-arg) { case 1: