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

Refactor how - and -- are handled #51

Open
integrii opened this issue Oct 25, 2019 · 1 comment
Open

Refactor how - and -- are handled #51

integrii opened this issue Oct 25, 2019 · 1 comment
Assignees
Labels
proposal Proposed changes to flaggy

Comments

@integrii
Copy link
Owner

In some circles, using a single - means that the next character will be a single-character flag and if there are multiple letters, they should be treated like a list of single-character flags. If a double dash is used (--) then we should consider the following characters all part of a single flag until a space or = is seen.

Right now, flaggy does not parse differently when it sees a - or --. This means that single letter flags can not be grouped up.

For example, this command would be parsed with two flags by some parsers:

docker exec -it

However in flaggy, this would be treated as one long flag named it.

I propose that we refactor flaggy with the following logic:

  • If a single dash (-) is used, then we treat every following character as its own flag
  • if a double dash (--) is used, then we treat the following as one long flag name
@integrii integrii added the proposal Proposed changes to flaggy label Oct 25, 2019
@integrii integrii self-assigned this Oct 25, 2019
@integrii
Copy link
Owner Author

Relevant to #49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Proposed changes to flaggy
Projects
None yet
Development

No branches or pull requests

1 participant