diff --git a/pkg/odo/cli/list/namespace/namespace.go b/pkg/odo/cli/list/namespace/namespace.go index 86b589dc61b..88eb3940a4b 100644 --- a/pkg/odo/cli/list/namespace/namespace.go +++ b/pkg/odo/cli/list/namespace/namespace.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "os" + "strings" "text/tabwriter" "github.com/redhat-developer/odo/pkg/api" @@ -98,11 +99,9 @@ func NewCmdNamespaceList(name, fullName string) *cobra.Command { if len(os.Args) > 2 { o.commandName = os.Args[2] } + // trim commandName if user passed a plural form - lastElement := len(o.commandName) - 1 - if o.commandName[lastElement] == byte('s') { - o.commandName = o.commandName[:lastElement] - } + o.commandName = strings.TrimSuffix(o.commandName, "s") projectListCmd := &cobra.Command{ Use: name, Short: listLongDesc,