Skip to content

Commit

Permalink
chore(args): update arg parsing to clap v3 (#49)
Browse files Browse the repository at this point in the history
* Update arg parsing to clap v3

* Refactor code

* Add help heading for flag arguments

* Reformat code

* chore(args): update help message of arguments

* chore(args): enable wrap_help feature of clap

* docs(readme): update command line arguments

* Add expect message for parsing sort_commits

Co-authored-by: Orhun Parmaksız <[email protected]>
  • Loading branch information
tranzystorekk and orhun authored Jan 31, 2022
1 parent 848d8a5 commit d961b53
Show file tree
Hide file tree
Showing 7 changed files with 161 additions and 156 deletions.
130 changes: 58 additions & 72 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ CARGO_TARGET_DIR=target cargo build --release
### Command Line Arguments

```
git-cliff [FLAGS] [OPTIONS] [RANGE]
git-cliff [FLAGS] [OPTIONS] [--] [RANGE]
```

**Flags:**
Expand All @@ -150,18 +150,18 @@ git-cliff [FLAGS] [OPTIONS] [RANGE]
**Options:**

```
-c, --config <PATH> Sets the configuration file [env: CONFIG=] [default: cliff.toml]
-w, --workdir <PATH> Sets the working directory [env: WORKDIR=]
-r, --repository <PATH> Sets the git repository [env: REPOSITORY=]
--include-path <PATTERN>... Sets the path to include related commits [env: INCLUDE_PATH=]
--exclude-path <PATTERN>... Sets the path to exclude related commits [env: EXCLUDE_PATH=]
--with-commit <MSG>... Sets custom commit messages to include in the changelog [env: WITH_COMMIT=]
-p, --prepend <PATH> Prepends entries to the given changelog file [env: PREPEND=
-o, --output <PATH> Writes output to the given file [env: OUTPUT=]
-t, --tag <TAG> Sets the tag for the latest version [env: TAG=]
-b, --body <TEMPLATE> Sets the template for the changelog body [env: TEMPLATE=]
-s, --strip <PART> Strips the given parts from the changelog [possible values: header, footer, all]
--sort <sort> Sets sorting of the commits inside sections [default: oldest] [possible values: oldest, newest]
-c, --config <PATH> Sets the configuration file [env: CONFIG=] [default: cliff.toml]
-w, --workdir <PATH> Sets the working directory [env: WORKDIR=]
-r, --repository <PATH> Sets the git repository [env: REPOSITORY=]
--include-path <PATTERN>... Sets the path to include related commits [env: INCLUDE_PATH=]
--exclude-path <PATTERN>... Sets the path to exclude related commits [env: EXCLUDE_PATH=]
--with-commit <MSG>... Sets custom commit messages to include in the changelog [env: WITH_COMMIT=]
-p, --prepend <PATH> Prepends entries to the given changelog file [env: PREPEND=]
-o, --output <PATH> Writes output to the given file [env: OUTPUT=]
-t, --tag <TAG> Sets the tag for the latest version [env: TAG=]
-b, --body <TEMPLATE> Sets the template for the changelog body [env: TEMPLATE=]
-s, --strip <PART> Strips the given parts from the changelog [possible values: header, footer, all]
--sort <SORT> Sets sorting of the commits inside sections [default: oldest] [possible values: oldest, newest]
```

**Args:**
Expand Down
8 changes: 4 additions & 4 deletions git-cliff/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ path = "src/bin/completions.rs"
pretty_env_logger = "0.4.0"
log = "0.4.14"
dirs-next = "2.0.0"
clap_complete = "3.0"

[dependencies.git-cliff-core]
version = "0.5.0" # managed by release.sh
path = "../git-cliff-core"

[dependencies.structopt]
version = "0.3.25"
default-features = false
features = ["suggestions", "color", "wrap_help"]
[dependencies.clap]
version = "3.0"
features = ["derive", "env", "wrap_help"]

[dev-dependencies]
pretty_assertions = "1.0.0"
Loading

0 comments on commit d961b53

Please sign in to comment.