hroptatyr / yuck

Your Umbrella Command Kit, a bog-standard command line option parser for C with all the knickknackery and whatnots.
Other
61 stars 7 forks source link

Can not create multiple subcommands #6

Closed czlars closed 9 years ago

czlars commented 9 years ago

My yuck file tries to define two subcommands:

Usage: rrcsctl Lists available subcommands.

Usage: rrcsctl zone [zone] Zone operations

-l, --list list all zones -k, --kill=zone kill zone

Usage: rrcsctl shm Shared Memory operations

-s, --stats show statistics

However, the generated yucc file merges the shm and zone commands together:

$ ./rrcsctl -h Usage: rrcsctl [OPTION]... COMMAND

Lists available subcommands.

COMMAND may be one of: zone Zone operations

Options accepted by all commands: -h, --help display this help and exit -V, --version output version information and exit

$ ./rrcsctl zone -h Usage: rrcsctl zone [OPTION]... [zone]

Zone operations

Common options: -h, --help display this help and exit -V, --version output version information and exit

Command-specific options: -l, --list list all zones -k, --kill=zone kill zone Usage: rrcsctl shm Shared Memory operations -s, --stats show statistics

Latest yuck version: $ yuck/src/yuck -V yuck 0.2.0.git53.c27c78c

What am I doing wrong?

Thanks.

hroptatyr commented 9 years ago

The first Usage line should read

Usage: rrcsctl COMMAND

to turn on the subcommand mode.

czlars commented 9 years ago

Hello,

thanks for your reply. Changing the first did not work either (and actually it does not follow the documentation example with the xmpl command), but the problem was caused by accidental leading space in the second subcommand definition.

Thanks, Jiri

The first Usage line should read Usage: rrcsctl COMMAND

to turn on the subcommand mode. — Reply to this email directly or view it on GitHub.

hroptatyr commented 9 years ago

Ah, sorry I misread the output.