summaryrefslogtreecommitdiff
path: root/cli/cli_main.cpp
diff options
context:
space:
mode:
authorJosé Fonseca <jose.r.fonseca@gmail.com>2012-01-31 10:02:52 +0000
committerJosé Fonseca <jose.r.fonseca@gmail.com>2012-01-31 10:03:24 +0000
commit54f752c09233cdb8e6149ac1e73b989bed367179 (patch)
tree13bc34eb28ff7fa6db01c77d131dafdc0393bd98 /cli/cli_main.cpp
parent689b6b2121e09d08437aab87b528e4c1de327d1c (diff)
Avoid hacking around argc / argv.
Diffstat (limited to 'cli/cli_main.cpp')
-rw-r--r--cli/cli_main.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/cli_main.cpp b/cli/cli_main.cpp
index a776107f..cff6a05d 100644
--- a/cli/cli_main.cpp
+++ b/cli/cli_main.cpp
@@ -122,12 +122,12 @@ do_help_command(int argc, char *argv[])
const Command *command;
int i;
- if (argc != 1) {
+ if (argc != 2) {
help_usage();
return 0;
}
- char *command_name = argv[0];
+ char *command_name = argv[1];
for (i = 0; i < ARRAY_SIZE(commands); i++) {
command = commands[i];
@@ -172,7 +172,7 @@ main(int argc, char **argv)
return 1;
}
- command_name = argv[i++];
+ command_name = argv[i];
argc -= i;
argv = &argv[i];