Skip to content

Broken output when --sub-commands option is given #3040

@urbalazs

Description

@urbalazs

Is there an existing issue for this?

  • There is no existing issue for this bug

Is this happening on an up to date version of Incus?

  • This is happening on a supported version of Incus

Incus system details

incus v6.22

Instance details

No response

Instance log

No response

Current behavior

Execute any incus command with --help option shows the global flags, too. For example incus list --help:

Global Flags:
      --debug          Show all debug messages
      --force-local    Force using the local unix socket
  -h, --help           Print help
      --project        Override the source project
  -q, --quiet          Don't show progress information
      --sub-commands   Use with help or --help to view sub-commands
  -v, --verbose        Show all information messages
      --version        Print version number

Addig the --sub-commands adds an extra indentation to the first line. For example: incus list --help --sub-commands:

Global Flags:
        --debug          Show all debug messages
      --force-local    Force using the local unix socket
  -h, --help           Print help
      --project        Override the source project
  -q, --quiet          Don't show progress information
      --sub-commands   Use with help or --help to view sub-commands
  -v, --verbose        Show all information messages
      --version        Print version number

Nice to have translations support for this tool, but please note that the section headers (Usage, Aliases, Examples, Available Commands, Flags, Global Flags, Additional help topics) are hard-coded in cmd/incus/main.go
Please mark these headers as translatable while fixing the bug.

Expected behavior

All output should be displayed with proper layout and localized, if translations are available.

Steps to reproduce

  1. Execute any incus command with --help option and see the Global Flags section.
  2. Execute the same command with --help --sub-commands option and see the Global Flags section. The first line has an extra indentation.

Metadata

Metadata

Assignees

Labels

EasyGood for new contributors

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions