kk-git 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/exe/kk-git +15 -1
  3. data/lib/kk/git/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8365947d559a7746f3665f7fa7ed53e6cb8459cee534a7366baaa30039653d64
4
- data.tar.gz: 94ea1cc2783338d9404bf9389f627bb9382e63c9be9c4b69308fa7f3299c2337
3
+ metadata.gz: 7d9014b93ea9dd165e25f518850042be4d5fc9db34ae9dfef0c58ad6048f7854
4
+ data.tar.gz: 74c6a6322b0750892c0d3368822906449c484423a053b1eb20735e8081fc79f5
5
5
  SHA512:
6
- metadata.gz: 4a17582a600ea34e3c118e9d180c76ea2a4b3c4cb8b8ca8a4528fd4c3d44458e79ba2bb627423f1ddc361f7db00450c1e6ad0bcef6919fb2ab60bfc5a86edba6
7
- data.tar.gz: 89fa04c6e32821b20c3db5831bcfc26651162d09dddc1f3c750102ed5a94ef0eba146283e7330c9774370f108c8d836da19388752d782b44e5e8c518aef12953
6
+ metadata.gz: c722139e54af3754afa25b7301ab7b5dcf2a9a0e864d8e97345e18ab632e300b7dc74e3814b7e8a80f21935cf296925d5cbac0fd51393af95662dca6c71c7fa1
7
+ data.tar.gz: ac29d630884974c8b857c858fd04cfe62570eabaf09bdd02b237cdcf78c46e7d076d7a34fdc02397dce099006759457f2b314e2fe07f7dc28cbbf49833638c85
data/exe/kk-git CHANGED
@@ -22,7 +22,10 @@ options = {
22
22
  }
23
23
 
24
24
  parser = OptionParser.new do |opts|
25
- opts.banner = "Usage: kk-git commit-message [options]\n\n根据当前 Git repo 变更生成 Conventional Commit 信息。"
25
+ opts.banner = "Usage:\n" \
26
+ " kk-git --version\n" \
27
+ " kk-git commit-message [options]\n\n" \
28
+ "根据当前 Git repo 变更生成 Conventional Commit 信息。"
26
29
 
27
30
  opts.on('--repo DIR', '指定 repo 目录(默认当前目录)') { |v| options[:repo_dir] = v }
28
31
 
@@ -45,6 +48,17 @@ parser = OptionParser.new do |opts|
45
48
  puts opts
46
49
  exit 0
47
50
  end
51
+
52
+ opts.on('-v', '--version', '显示版本号') do
53
+ puts KKGit::VERSION
54
+ exit 0
55
+ end
56
+ end
57
+
58
+ # 支持 `kk-git --version` 这种无子命令形式
59
+ if ['--version', '-v'].include?(ARGV[0])
60
+ puts KKGit::VERSION
61
+ exit 0
48
62
  end
49
63
 
50
64
  subcommand = ARGV.shift
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KKGit
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kk-git
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - kk