Pranit Bauva <pranit.ba...@gmail.com> writes: >>> +`OPT_CMDMODE(short, long, &int_var, description, enum_val)`:: >>> + Introduce an option for subcommands. It is useful when you want to use >>> + the command with a particular sub command only and ignore other sub >>> + commands it has. It will set `int_var` to enum_val if the argument is >>> + invoked. >>> + >> >> Sorry, but I do not get what "when you want to... ignore other sub >> command it has" wants to say. > > What I meant by this statement is that (your example), let's say we > have "add", "remove" and "edit" sub commands. Now the user has to pick > between the three. He cannot choose more than 1 from these.
Then I find the word "ignore others" misleading. Quite the contrary, the user has to be aware of the others and not to give them. Define an "operating mode" option, only one of which in the same group of "operating mode" options that share the same `int_var` can be given by the user. `enum_val` is set to `int_var` when the option is used, but an error is reported if other "operating mode" option has already set its value to the same `int_var`. or something? -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html