You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we can use `Command.Version` and `Command.SetVersionTemplate`, which generally works fine.
I would like to propose a `Command.SetVersionFunc`, similar to `command.SetHelpFunc`.
The rationale behind it is that the caller can style the output conditionally, e.g.:
```
$ pgr -v
styled version output
$ pgr -v | cat
plain-text version output (output not a tty)
```
Right now, the way around it is to, before executing the root command, check if output is a terminal, detect color profile, build and set a styled template.
This works, but can interfere with content being piped in/out (e.g. if you want to detect terminal background color and other terminal features).
Signed-off-by: Carlos Alexandro Becker <[email protected]>
0 commit comments