Ability to hide/show some options depending on platform #229
-
Is it possible to hide or show some options depending on the platform. For instance, let's say i've got Windows-specific options, could it be possible to show them only when running/compiled on Windows, but not on e.g. Linux? |
Beta Was this translation helpful? Give feedback.
Answered by
alecthomas
Oct 27, 2021
Replies: 1 comment
-
The simplest solution would be to use Go's OS build tags. Have a file for each OS containing an |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
alecthomas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The simplest solution would be to use Go's OS build tags. Have a file for each OS containing an
osSpecificFlags
struct that you embed in your main CLI struct.