3.2.2 Negated Packs

In a very similar way, a negated pack allows you to group multiple negated forms in a single command-line item. As such, this feature only applies to switches or switch-based options (see Switches). For instance, instead of calling your program like this: ‘program +c +u +p’, you can directly use: ‘program +cup’.

A negated pack can only contain options the short names of which are exactly one character long. Also, remember that negated forms never take any argument.

Beware that using negated packs comes at the risk of ambiguity (although much less than with short packs). When Clon parses a command-line item beginning with a ‘+’, it tries to detect options first, and then negated packs. For that reason, the order in which you specify the options in the pack is important. Indeed, suppose that your application has a ‘+cup’ switch (this would be a very bad idea, but still…). If you want to provide the same pack as above, then you need to modify the options order, like this: ‘+ucp’.

A single command-line may contain as many negated packs as you like, and they can also be intermixed with regular option calls or short packs.