Skip to content

Increment feature #51

@chriskilding

Description

@chriskilding

Add a feature that increments the input semantic version(s), because this is a reasonably common thing that people want to do with semantic version numbers.

The feature should be able to operate in combination with the other features, e.g. semver -s -i major.

Possible designs:

--increment <component>

One CLI option, which takes one component (major, minor, or patch) as its argument:

semver -i major
semver --increment major

semver -i minor
semver --increment minor

semver -i patch
semver --increment patch

Example:

semver -i minor <<< "1.2.3"
# => 1.3.0

--increment-major, --increment-minor, --increment-patch

Multiple CLI options:

semver -m
semver --increment-major

semver -n
semver --increment-minor

semver -p
semver --increment-patch

Example:

semver -n <<< "1.2.3"
# => 1.3.0

The fact that there are multiple options means it is also technically possible to combine them i.e. semver -mnp. We would need to work out if this is useful or even desirable:

semver -np <<< "1.2.3"
# => 1.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions