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

Allow "G", "M" and 'k' when parsing arguments #397

Open
UweBonnes opened this issue Mar 9, 2023 · 2 comments
Open

Allow "G", "M" and 'k' when parsing arguments #397

UweBonnes opened this issue Mar 9, 2023 · 2 comments

Comments

@UweBonnes
Copy link

openFPGALoader uses cxxopts for argument parsing. To dump the content from some flash chip, a size argument must be given. At resent I must use "--file-size 1000000" to read 1MByte, What would it take to understand "--file-size 1M"? At the moment leaving "M" and "Mi" asinde ;-)

@jarro2783
Copy link
Owner

I think this should be up to the application to deal with. Although you can implement this yourself using a custom type.

You can overload cxxopts::parse_value to add a parser for a custom type.

@nigels-com
Copy link
Contributor

That would be nice to have out of the box. Both SI powers of 10 and computer powers of 2.

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

3 participants