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

flag.sh: Add ability parse combined short flags #6

Open
nhooyr opened this issue Nov 12, 2022 · 1 comment
Open

flag.sh: Add ability parse combined short flags #6

nhooyr opened this issue Nov 12, 2022 · 1 comment

Comments

@nhooyr
Copy link
Contributor

nhooyr commented Nov 12, 2022

like -bfzs

Should be parsed as 4 separate flags, not one whole bfzs.

I'm thinking I add a function to iterate through each character somehow and if they don't recognize one of the characters as a flag or it wasn't a single hyphen flag, then we error out.

@nhooyr
Copy link
Contributor Author

nhooyr commented Nov 14, 2022

Maybe flag.sh should be changed to use getopts in combination. Perhaps long flags could be supported by a separate optstring.

This would also solve parsing of flags like -oarg where there is no separator between the flag and the argument.

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

No branches or pull requests

1 participant