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

replacing getopt_long() in getopt command #202

Open
E5ten opened this issue May 27, 2020 · 2 comments
Open

replacing getopt_long() in getopt command #202

E5ten opened this issue May 27, 2020 · 2 comments

Comments

@E5ten
Copy link
Contributor

E5ten commented May 27, 2020

@landley If I was able to (by copying a lot of code from https://github.com/skeeto/optparse, which is public domain), replace the use of the non-standard GNU getopt_long{,_only}() functions in the getopt command, would you be in favour of that? If so, I'll give that a shot.

@landley
Copy link
Owner

landley commented May 27, 2020

I have no idea what to do about getopt, I don't use it and the shell builtin "getopts" is different.

It's not the "it's in glibc and musl and uclibc and bionic and macos and bsd but posix hasn't noticed yet" functions I care about, it's that lib/args.c is a complete set of parsing logic and this pulls in a whole second set of parsing logic with zero code reuse.

@E5ten
Copy link
Contributor Author

E5ten commented May 27, 2020

I guess since the toybox parsing is done by pregenerating #defines before actual compilation it wouldn't really be doable to use the arguments to getopt to build something that toybox's parsing could handle right?

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