[sheepdog] [PATCH v6 14/16] collie: fix collie failure when sub-subcommand has more than 2 arguments

Kai Zhang kyle at zelin.io
Tue May 21 12:11:16 CEST 2013


Support command like this:
$collie command subcommand sub-subcommand arg1 arg2

Signed-off-by: Kai Zhang <kyle at zelin.io>
---
 collie/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/collie/common.c b/collie/common.c
index 8dacbd4..2b08db1 100644
--- a/collie/common.c
+++ b/collie/common.c
@@ -225,7 +225,7 @@ int do_generic_subcommand(struct subcommand *sub, int argc, char **argv)
 			}
 
 			if (flags & SUBCMD_FLAG_NEED_ARG
-			    && argc != 5)
+			    && argc < 5)
 				subcommand_usage(argv[1], argv[2], EXIT_USAGE);
 			optind++;
 			ret = sub[i].fn(argc, argv);
-- 
1.7.1




More information about the sheepdog mailing list