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

Use real options parser #136

Open
miltieIV2 opened this issue Dec 19, 2022 · 2 comments
Open

Use real options parser #136

miltieIV2 opened this issue Dec 19, 2022 · 2 comments

Comments

@miltieIV2
Copy link

Hand coded options parses are always a bad idea.

At least use getopts BASH built-in: https://wiki.bash-hackers.org/howto/getopts_tutorial

Or even better, getoptions: https://dev.to/ko1nksm/the-easiest-way-to-parse-arguments-using-getoptions-for-bash-and-shell-scripts-47p5

@johanhaleby
Copy link
Owner

That would be pretty neat. So getopts is built-in to bash? There's no need for an extra dependency or something like that?

@miltieIV2
Copy link
Author

Yeah, getopts is built-in, but only single letter, so it would break your existing long options. The getoptions path would mean pulling in more external stuff, but you give you more expected, standard behavior. It took me several iterations to figure out that the pod name has to come first or it just plain doesn't work.

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

2 participants