Specify short form of CLAP flag, when having multiple flags starting with same letter
Enhance ClapFlag with option to specify short form of flag name.
Describe the request
Currently, short form ClapFlag instance is always represented by first letter of long version name. This causes a problem, when having multiple flags starting with same letter, e.g. noHeader and name. There should be an option to specify short name programmatically (when specifying command) in order to avoid name conficts.
Expected behavior
(ClapFlag id: #name)
description: 'Name description.';
shortName: 'n';
...
(ClapFlag id: #noHeader)
description: 'No header description.';
shortName: 'h';
Expected development cost
- Add instance variable on ClapFlag class and setter method.
- Modify shortName getter method to access instance variable and assign first letter substring in initialize method (or lazy assignment).
Version information:
- reported on CLAP version: https://github.com/pharo-contributions/clap-st/commit/1163bdebb627eb9c14f79c8e66c1817c842e102c
👍🏻 I would advise keeping the dash out of the shortName: though.
At some point I was thinking of aliases instead of just short/long names, because many commands have synonymous flags, or variants with slight semantic differences like --foo / --no-foo
I would advise keeping the dash out of the shortName: though.
Got it! Dash removed from example.