traitlets icon indicating copy to clipboard operation
traitlets copied to clipboard

short flags

Open nbiederbeck opened this issue 4 years ago • 0 comments

I can create short flags like this:

flags = {
    ("f", "overwrite"): (
        {"DataWriter": {"overwrite": True}},
        "Overwrite output file if it exists",
    ),
}

which gives me -f, --overwrite.

and yes/no flags with

traitlets.config.boolean_flag(
    "overwrite",
    "DataWriter.overwrite",
    "Overwrite output file if it exists",
    "Don't overwrite output file if it exists",
)

which gives me --overwrite, --no-overwrite.

Is it possible to add the possibility to create short/long/no flags? e.g. like

traitlets.config.boolean_flag(
    ("f", "overwrite"),
    "DataWriter.overwrite",
    "Overwrite output file if it exists",
    "Don't overwrite output file if it exists",
)

(for -f, --overwrite, --overwrite )

nbiederbeck avatar Jun 04 '21 10:06 nbiederbeck