Skip to content

Disabling automatic creation of --no-* flag for boolean flags #24

@gadenbuie

Description

@gadenbuie

Is it possible to disable the creation of the --no-* flags for boolean value flags? Sometimes, in cases like --version, you may not want the explicit false option.

❯ _dev/reprex-cli-boolean-flag.R --help
Usage: my-app [OPTIONS]

A simple example CLI app.

Options:
  --version / --no-version  Print version and exit. [default: false]
                            Enable with `--version`.
#!/usr/bin/env Rapp
#| name: my-app
#| description: A simple example CLI app.

#| description: Print version and exit.
version <- FALSE

if (version) {
  cat("my-app 1.0.0\n")
  quit(status = 0)
}

cat("Hello, world!\n")

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