Function
LongestCommandName
(cmds map[string]sharedaction.CommandInfo, pluginCmds []configv3.PluginCommand)
Source from the content-addressed store, hash-verified
| 53 | } |
| 54 | |
| 55 | func LongestCommandName(cmds map[string]sharedaction.CommandInfo, pluginCmds []configv3.PluginCommand) int { |
| 56 | longest := 0 |
| 57 | for name := range cmds { |
| 58 | if len(name) > longest { |
| 59 | longest = len(name) |
| 60 | } |
| 61 | } |
| 62 | for _, command := range pluginCmds { |
| 63 | if len(command.Name) > longest { |
| 64 | longest = len(command.Name) |
| 65 | } |
| 66 | } |
| 67 | return longest |
| 68 | } |
| 69 | |
| 70 | func LongestFlagWidth(flags []sharedaction.CommandFlag) int { |
| 71 | longest := 0 |
Tested by
no test coverage detected