[go: up one dir, main page]

Avoid errors: unknown command "help" for "glab ..."

Checklist

  • I'm using the latest version of the extension (Run glab --version)
    • Extension version: glab version 1.40.0 (2024-04-24)
  • Operating system and version: Put your version here
  • Gitlab.com or self-managed instance? gitlab.com/self-managed instance/both
  • GitLab version (if self-managed) GitLab version here (Use the version endpoint, like this: gitlab.my-company.com/api/v4/version)
  • I have performed glab auth status to check for authentication issues

Summary

The currently documented glab ... help examples result in errors:

unknown command "help" for "glab ..."

Did you mean this?
	--help

There seems to be a systematic problem with help being considered an option or (sub-)sub-command of all (sub)commands, while actually --help is the correct option/flag and all (sub)command names being a parameter for the glab help command.

Environment

Steps to reproduce

Try any glab ... help example.

What is the current bug behavior?

Error

What is the expected correct behavior?

The output one gets with glab help ... or glab ... --help/-h.

Relevant logs and/or screenshots

$ diff <(glab help alias) <(glab alias help)   | wc -l
      29
$ diff <(glab help alias) <(glab alias --help) | wc -l
       0
$ diff <(glab help alias) <(glab alias -h)     | wc -l
       0

The latter 2 pairs are the same & correct.

Possible fixes

Update to gen-docs/docs.go to output the correct order: glab help ... or the correct flag glab ... --help. I'm not sure whether or not this is an upstream problem, maybe with name := cmd.CommandPath() already. It seems to be emitting the wrong order.