Skip to content

Confusing behaviour command line options with default value 'true' #129671

Open
@JVApen

Description

@JVApen

In clang-include-cleaner, there are some options that have a default value 'true'.

For example:

cl::opt<bool> Remove{
"remove",
cl::desc("Allow header removals"),
cl::init(true),
cl::cat(IncludeCleaner),
};

When using the --help for it, it tells the following:

USAGE: clang-include-cleaner.exe [options] <source0> [... <sourceN>]

OPTIONS:
  ...
  --remove                    - Allow header removals
  --version                   - Display the version of this program

This seems to imply that you have to add '--remove' in order to active the example option.
However, this is enabled by default. If you don't want the 'removal' behavior, you have to add --remove=false to the command line. This is nowhere to be found in the help message.

Can the command line output be improved such that default options are somehow indicated and it is easy to see how to disable them? For example --remove - Allow header removals (Default, use --remove=false to disable)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions