Skip to content

Render negatable options as --[no-]name instead of separate entries #456

@stalep

Description

@stalep

Summary

Negatable options are rendered as two separate entries in the help output. The conventional format (used by picocli and other CLI frameworks) is a single combined entry with --[no-] prefix.

Current output

  --cds, --no-cds                          If specified Class Data Sharing (CDS) will be used...
  --integrations, --no-integrations        Enable or disable integration execution (default: true)

Expected output

  --[no-]cds                               If specified Class Data Sharing (CDS) will be used...
  --[no-]integrations                      Enable or disable integration execution (default: true)

The --[no-] format:

  • Makes it immediately clear this is a single option with a negation form, not two separate options
  • Is more compact
  • Follows the convention established by picocli, GNU tools, and npm
  • Should also apply in the synopsis: [--[no-]cds] instead of [--cds] with --no-cds as a hidden implicit

Context

Found in jbang (jbangdev/jbang#2453). Picocli rendered negatable options as --[no-]cds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions