Skip to content

Allow lower case names for SemVer --increment  #533

@edgarrmondragon

Description

@edgarrmondragon

Description

The cz cli only accepts upper case increment names, but some tools work with lower case names for the same increment types. So, to keep things simpler in scripts, it'd be great to don't care about transforming to lower/upper case.

Possible Solution

Since decli is mostly a declarative wrapper around argparse, maybe a simple str.upper can be used as the type for increment.

This seems to work:

# rps.py
import argparse

parser = argparse.ArgumentParser()
parser.add_argument(
    'move',
    choices=['ROCK', 'PAPER', 'SCISSORS'],
    type=str.upper,
)

args = parser.parse_args()
print(args.move)
$ python rps.py rock     
ROCK

Additional context

I can submit a PR if this is desirable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions