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

Is it possible to have a cmd.Flags().Uint64P accept decimal OR hex values as valid? #1791

Open
blacktop opened this issue Aug 31, 2022 · 5 comments
Labels
area/flags-args Changes to functionality around command line flags and args kind/bug A bug in cobra; unintended behavior

Comments

@blacktop
Copy link

I could have sworn I've seen an example where you can have a custom flag parsing func OR a way to set a Uint flag to accept either hex or dec values from the command line?

Thanks!

@blacktop
Copy link
Author

It looks like this IS supposed to work by default, but due to an error in the cast pkg it doesn't. @spf13

@johnSchnake johnSchnake added kind/bug A bug in cobra; unintended behavior area/flags-args Changes to functionality around command line flags and args labels Sep 7, 2022
@github-actions
Copy link

github-actions bot commented Nov 7, 2022

The Cobra project currently lacks enough contributors to adequately respond to all issues. This bot triages issues and PRs according to the following rules:

  • After 60d of inactivity, lifecycle/stale is applied. - After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied and the issue is closed.
    You can:
  • Make a comment to remove the stale label and show your support. The 60 days reset. - If an issue has lifecycle/rotten and is closed, comment and ask maintainers if they'd be interseted in reopening

@blacktop
Copy link
Author

blacktop commented Nov 7, 2022

It looks like there's 2 PRs trying to fix this - spf13/cast#144 as well

@github-actions
Copy link

github-actions bot commented Jan 8, 2023

The Cobra project currently lacks enough contributors to adequately respond to all issues. This bot triages issues and PRs according to the following rules:

  • After 60d of inactivity, lifecycle/stale is applied. - After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied and the issue is closed.
    You can:
  • Make a comment to remove the stale label and show your support. The 60 days reset. - If an issue has lifecycle/rotten and is closed, comment and ask maintainers if they'd be interested in reopening

@blacktop
Copy link
Author

blacktop commented Jun 6, 2024

There seems to be 4 PRs in cast trying to fix this and the fix seems pretty straight forward. Can we please get some eyes on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/flags-args Changes to functionality around command line flags and args kind/bug A bug in cobra; unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants