fix(commands): do not offer filename completions if no args taken

Description

If a command does not take any positional arguments, there's no reason to offer filename completions for it.

Unfortunately, Cobra is currently not able to take care of this automatically, https://github.com/spf13/cobra/issues/1969

Does not resolve, but relates to #8167 (closed)

How has this been tested?

$ export PATH=$PWD:$PATH
$ go build ./cmd/glab ; complete -r glab ; . <(glab completion -s bash)  # rinse, repeat

Then, invoke tab-completion for a command affected by this MR, verify no completions are offered. For example, glab alias list <TAB>.

Also, ran the test suite.

Screenshots (if appropriate):

Merge request reports

Loading
Loading