Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issue #752 #823

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vigneashs
Copy link

@vigneashs vigneashs commented Jun 2, 2022

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
Copy link
Member

ericnewton76 commented Sep 10, 2022

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants