cl 0.1.6 → 0.1.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d8b11aefb42c1dd4ae929b2b446a99c1387d5a72d8eec551ce60c597b96fd5a
4
- data.tar.gz: 334eb82a210381312bb0c2b363ded74d6475334891d1bf233cddc1840e818272
3
+ metadata.gz: 783766818dfc341de7cf605455055f41492ac4a01cb4debcdd66ea6565feef1c
4
+ data.tar.gz: 3b56597b8b07dadef0c936400b53f8b72d1a55ea111c3dde9fcea4584e98b580
5
5
  SHA512:
6
- metadata.gz: cb6223e4079a9d1524a3519f146ae23902fcb3c9b936941e98ae88deff88b088278ac34b3905e7dc8eca067fac31994b7407cadc43f4db08af4b949ea443294e
7
- data.tar.gz: ce7ff7f47ba1dc0305d93d29a42c3a7a5bebbeda4acb9904816f6215380f3dc3c2838c90601129f6a4e31bd46ec6c392ab6fe9d99c0c54195f2173b4879c29bc
6
+ metadata.gz: 4f3d25d8a5cdc5bd018c383fcbd8c85d2cb95f6cf9688aee99c8b602ec7f1205490ea03b919147d5e7fb655a6cc7bc7401d1ddcf558d290adf1075802cf04aaa
7
+ data.tar.gz: 4ce2f0cf7b79eb4355f7aee5c187764b85b8608944a275a5dc6e2bb732f8b91c2003342b2163886c9f86b8ac6e69d798b18264d3f0cd5085dd84dec3eda1b857
data/CHANGELOG.md CHANGED
@@ -17,6 +17,7 @@
17
17
  * Add `opt '--one STR', format: /.+/`
18
18
  * Add `opt '--one STR', enum: ['one', /\w+/]`
19
19
  * Add `opt '--one STR', downcase: true`
20
+ * Add `opt '--one STR', internal: true`, hide internal options from help output
20
21
  * Add `opt '--one STR', example: 'foo'`
21
22
  * Add `opt '--one STR', see: 'https://provider.com/docs'
22
23
 
data/lib/cl/help/cmd.rb CHANGED
@@ -54,6 +54,7 @@ class Cl
54
54
  def opts
55
55
  @opts ||= begin
56
56
  opts = cmd.opts.to_a
57
+ opts = opts.reject(&:internal?)
57
58
  opts = opts - cmd.superclass.opts.to_a if common?
58
59
  strs = Table.new(rjust(opts.map { |opt| [*opt.strs] }))
59
60
  opts = opts.map { |opt| format_obj(opt) }
data/lib/cl/opt.rb CHANGED
@@ -115,6 +115,10 @@ class Cl
115
115
  opts[:format] =~ value
116
116
  end
117
117
 
118
+ def internal?
119
+ !!opts[:internal]
120
+ end
121
+
118
122
  def max?
119
123
  int? && !!opts[:max]
120
124
  end
data/lib/cl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Cl
2
- VERSION = '0.1.6'
2
+ VERSION = '0.1.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-14 00:00:00.000000000 Z
11
+ date: 2019-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: regstry
@@ -41,7 +41,6 @@ files:
41
41
  - examples/args/splat
42
42
  - examples/gem
43
43
  - examples/heroku
44
- - examples/owners
45
44
  - examples/rakeish
46
45
  - lib/cl.rb
47
46
  - lib/cl/arg.rb
data/examples/owners DELETED
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env ruby
2
- $: << File.expand_path('lib')
3
-
4
- # Example from the README
5
-
6
- require 'cl'
7
-
8
- module Owners
9
- class Add < Cl::Cmd
10
-
11
- register 'owners:add'
12
-
13
- summary 'Add one or more owners to an existing owner group'
14
-
15
- description <<~str
16
- Use this command to add one or more owners to an existing
17
- owner group.
18
-
19
- These will be visible in [...]
20
- str
21
-
22
- args :owners #, 'Comma separated list of owner login names who are to be added to the owner group'
23
-
24
- opt '-t', '--to TO', 'An existing owner group', required: true
25
- end
26
- end
27
-
28
- Cl.new($0).run(%w(add --help))