Skip to content

Fixes issue #752 - #823

Open
vigneashs wants to merge 1 commit into
commandlineparser:masterfrom
vigneashs:dev/vigneashs/issue752
Open

vigneashs wants to merge 1 commit into
commandlineparser:masterfrom
vigneashs:dev/vigneashs/issue752

Conversation

@vigneashs

@vigneashs vigneashs commented Jun 2, 2022 •

Copy link
Copy Markdown

Current OptionAttribute have a limitation of shortName being able to be set to just one character. This creates a limitation in the functionality of giving more readable or rememberable short names. For example, -FileSystem can be made to -FS.

This PR tends to address this limitation.

PS: this my first PR with this repository, let me know if more test cases have to be added.

Issue #752

@ericnewton76

ericnewton76 commented Sep 10, 2022 •

Copy link
Copy Markdown
Member

Thank you for submitting.

the design goal of shortname originates from the original getopt parser... you cant have a -FS if you have -F and a -S because how does the parser distinguish?

if you want a short version of --FileSystem then create --FS option.

IMO I dont feel like this is a good move.

It could be argued to try to match Longest shortName first. but then there needs to be conflict reporting if a user creates

[Option("FS", "FileSystem")]
public string FileSystem { get; set; }
//and
[Option("S", "FS")]
public string FileStatus { get; set; }

This adds a whole bunch of need for testing/conflict resolution and reporting logic to be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants