generated from axetroy/go-cli-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
761 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
whatchanged - 一个为 Git 项目生成变更日志的命令行工具 | ||
|
||
USAGE: | ||
whatchanged [OPTIONS] [ARGUMENTS...] | ||
|
||
ARGUMENTS: | ||
[version...] 可选的版本或者版本范围,它有一下几种值 | ||
1.null. | ||
如果你没有指定版本,则会自动从 "HEAD~<latest tag>" / | ||
"HEAD~<earliest commit>" / "<latest tag>-<prev tag>" | ||
中选择一个进行生成 | ||
2.单版本,例如 "v1.2.0" | ||
生成单个指定版本的变更日志 | ||
3.多版本,例如 "v2.0.0 v1.0.0" | ||
4.版本范围,例如 v1.3.0~v1.2.0 | ||
生成这两个版本以及中间版本的变更日志。 | ||
格式: <开始>~<结束> | ||
|
||
OPTIONS: | ||
--help 打印帮助信息。 | ||
--version 打印版本信息。 | ||
--project 指定要生成的 Git 项目,它可以是一个相对/绝对路径或者远程地址。例如: | ||
--project=/path/to/project/which/contains/.git/folder | ||
--project=https://github.com/whatchanged-community/whatchanged.git | ||
默认值: "--project=$PWD". | ||
--branch 指定要克隆的分支,仅在生成远程仓库时有效。 | ||
默认值: "--branch=master" | ||
--output 指定输入文件,默认输出到 stdout(标准输出流)。 | ||
--fmt 指定生成的格式,可选项: | ||
--fmt=md | ||
--fmt=json | ||
默认值: "--fmt=md". | ||
--preset 指定内置的 markdown 预设模版. 可选项: | ||
--preset=default | ||
--preset=full | ||
--preset=simple | ||
仅在设置 --fmt=md 并且 --tpl 为空时有效。 | ||
默认值: "--preset=default". | ||
--tpl 指定渲染的 markdown 模版。仅在 --fmt=md 时有效。 | ||
--skip-format 跳过格式化过程,一般情况下可以忽略 | ||
|
||
EXAMPLES: | ||
# 生成从 HEAD 到 <latest tag> 的变更日志。 | ||
# 如果 HEAD 不是最新的 tag,则变更日志应该是一个未发布版本。 | ||
# 否则生成最新版 | ||
$ whatchanged | ||
|
||
# 生成指定版本的变更日志 | ||
$ whatchanged v1.2.0 | ||
|
||
# 生成指定两个版本的变更日志 | ||
# 只会生成这两个版本的日志,中间版本会被忽略 | ||
$ whatchanged v2.0.0 v1.0.0 | ||
|
||
# 生成从 HEAD 到最新一个 tag 和第 N 个 tag 的变更日志 | ||
$ whatchanged HEAD~@0 @1 @2 | ||
|
||
# 生成两个版本范围内的变更日志,中间版本也会生成,例如 v1.3.0, v1.2.1, v1.2.0 | ||
$ whatchanged v1.3.0~v1.2.0 | ||
|
||
# 生成从 HEAD 到第 N 个 tag 的变更日志 | ||
$ whatchanged ~@0 | ||
|
||
# 生成第 0 个 tag 到第 2 个tag 的变更日志 | ||
$ whatchanged @0~@2 | ||
|
||
# 生成 HEAD 到指定版本的变更日志 | ||
$ whatchanged HEAD~v1.3.0 | ||
|
||
# 生成所有的变更日志 | ||
$ whatchanged HEAD~ | ||
|
||
# 生成两次提交之间的变更日志 | ||
$ whatchanged 770ed02~585445d | ||
|
||
# 生成本地项目的变更日志 | ||
$ whatchanged --project=/path/to/project v1.0.0 | ||
|
||
# 生成远程项目的变更日志 | ||
$ whatchanged --project=https://github.com/whatchanged-community/whatchanged.git v0.1.0 | ||
|
||
SOURCE CODE: | ||
https://github.com/whatchanged-community/whatchanged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
whatchanged - a cli to generate changelog from git project | ||
|
||
USAGE: | ||
whatchanged [OPTIONS] [ARGUMENTS...] | ||
|
||
ARGUMENTS: | ||
[version...] Optional version or version range. | ||
1.null. | ||
If you do not specify the version, then it will automatically | ||
generate a change log from "HEAD~<latest version>" or | ||
"HEAD~<earliest commit>" or "<latest version>-<last version>" | ||
2.single version. eg. "v1.2.0" | ||
Generate a specific version of the changelog. | ||
3.multiple versions. eg. "v2.0.0 v1.0.0" | ||
4.version range. eg v1.3.0~v1.2.0 | ||
Generate changelog within the specified range. | ||
For more details, please check the following examples. | ||
|
||
OPTIONS: | ||
--help Print help information. | ||
--version Print version information. | ||
--project Specify the project to be generated. It can be a relative path. | ||
or an absolute path or even a remote Git URL. eg. | ||
--project=/path/to/project/which/contains/.git/folder | ||
--project=https://github.com/whatchanged-community/whatchanged.git | ||
Defaults to "--project=$PWD". | ||
--branch Specify clone branch. only works for remote git project. | ||
Defaults to "--branch=master" | ||
--output Write output to file. default write to stdout. | ||
--fmt Specify the changelog format. Available options: | ||
--fmt=md | ||
--fmt=json | ||
Defaults to "--fmt=md". | ||
--preset Cli built-in markdown template. Available options: | ||
--preset=default | ||
--preset=full | ||
--preset=simple | ||
Only available when --fmt=md and --tpl is nil. | ||
Defaults to "--preset=default". | ||
--tpl Specify the template file for generating. Only available when | ||
--fmt=md. | ||
--skip-format Skip the formatting process, which is very useful for keeping the | ||
original format. | ||
|
||
EXAMPLES: | ||
# generate changelog from HEAD to <latest tag>. | ||
# if HEAD is not the latest tag. then this should be a unreleased version | ||
# otherwise it should be the latest tag | ||
$ whatchanged | ||
|
||
# generate changelog of the specified version | ||
$ whatchanged v1.2.0 | ||
|
||
# Generate the specified two versions | ||
# the middle version will not be generated | ||
$ whatchanged v2.0.0 v1.0.0 | ||
|
||
# generate HEAD to latest tag and <Nth tag> | ||
$ whatchanged HEAD~@0 @1 @2 | ||
|
||
# generate changelog within the specified range | ||
$ whatchanged v1.3.0~v1.2.0 | ||
|
||
# generate changelog from HEAD to <Nth tag> | ||
$ whatchanged ~@0 | ||
|
||
# generate changelog from <0th tag> to <2th tag> | ||
$ whatchanged @0~@2 | ||
|
||
# generate changelog from HEAD to specified version | ||
$ whatchanged HEAD~v1.3.0 | ||
|
||
# generate all changelog | ||
$ whatchanged HEAD~ | ||
|
||
# generate changelog from two commit hashes | ||
$ whatchanged 770ed02~585445d | ||
|
||
# Generate changelog for the specified project | ||
$ whatchanged --project=/path/to/project v1.0.0 | ||
|
||
# Generate changelog for the remote project | ||
$ whatchanged --project=https://github.com/whatchanged-community/whatchanged.git v0.1.0 | ||
|
||
SOURCE CODE: | ||
https://github.com/whatchanged-community/whatchanged |
Oops, something went wrong.