cli: define const for magic value
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
9fda9134a9
commit
d8e76bc33f
@ -337,8 +337,10 @@ func operationSubCommands(cmd *cobra.Command) []*cobra.Command {
|
|||||||
return cmds
|
return cmds
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const defaultTermWidth = 80
|
||||||
|
|
||||||
func wrappedFlagUsages(cmd *cobra.Command) string {
|
func wrappedFlagUsages(cmd *cobra.Command) string {
|
||||||
width := 80
|
width := defaultTermWidth
|
||||||
if ws, err := term.GetWinsize(0); err == nil {
|
if ws, err := term.GetWinsize(0); err == nil {
|
||||||
width = int(ws.Width)
|
width = int(ws.Width)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user