cobra icon indicating copy to clipboard operation
cobra copied to clipboard

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

Open blacktop opened this issue 2 years ago • 5 comments

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 avatar Aug 31 '22 00:08 blacktop

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

blacktop avatar Aug 31 '22 00:08 blacktop

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

github-actions[bot] avatar Nov 07 '22 00:11 github-actions[bot]

It looks like there's 2 PRs trying to fix this - https://github.com/spf13/cast/pull/144 as well

blacktop avatar Nov 07 '22 00:11 blacktop

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

github-actions[bot] avatar Jan 08 '23 00:01 github-actions[bot]

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?

blacktop avatar Jun 06 '24 15:06 blacktop