Trims whitespace from command arguments in RootCmd (#24218)
- Prevents commands from receiving potential whitespace characters - Adds a new root test case ensuring various whitespace characters are removed Co-authored-by: Nathan Geist <ngeist@spiria.com>
Этот коммит содержится в:
@@ -73,6 +73,9 @@ var RootCmd = &cobra.Command{
|
||||
Long: `Mattermost offers workplace messaging across web, PC and phones with archiving, search and integration with your existing systems. Documentation available at https://docs.mattermost.com`,
|
||||
DisableAutoGenTag: true,
|
||||
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
||||
for i, arg := range args {
|
||||
args[i] = strings.TrimSpace(arg)
|
||||
}
|
||||
format := viper.GetString("format")
|
||||
if viper.GetBool("disable-pager") {
|
||||
printer.OverrideEnablePager(false)
|
||||
|
||||
Ссылка в новой задаче
Block a user