Skip to content

Binary flags vs default=None: semantics and issue with prompt #1992

@janluke

Description

@janluke

The current behavior is:

  • if default is not provided, the option default is set to False
  • if default is set to None, default is set to None.

I think this may be accidental behavior but it's not senseless: settings default=None you can force the prompt to require an explicit value to be provided (it'll be [y/n] rather than [y/N]).

Nonetheless, I noticed that if you provide default=None to a flag not having a secondary option, the prompt message is broken: it won't include "[y/n]" at the end.

Originally posted by @janluke in #1965 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions