diff --git a/pkg/cli/cmd.go b/pkg/cli/cmd.go index 5fb87a1..2902035 100644 --- a/pkg/cli/cmd.go +++ b/pkg/cli/cmd.go @@ -140,7 +140,11 @@ var viewCmd = &cobra.Command{ fmt.Println() }, ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - return store.ConverstionShortNameCompletions(toComplete), cobra.ShellCompDirectiveNoFileComp + compMode := cobra.ShellCompDirectiveNoFileComp + if len(args) != 0 { + return nil, compMode + } + return store.ConversationShortNameCompletions(toComplete), compMode }, } diff --git a/pkg/cli/store.go b/pkg/cli/store.go index 417a4ff..dced414 100644 --- a/pkg/cli/store.go +++ b/pkg/cli/store.go @@ -96,7 +96,7 @@ func (s *Store) Conversations() ([]Conversation, error) { return conversations, err } -func (s *Store) ConverstionShortNameCompletions(shortName string) []string { +func (s *Store) ConversationShortNameCompletions(shortName string) []string { var completions []string conversations, _ := s.Conversations() // ignore error for completions for _, conversation := range conversations {