cl 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +63 -10
- data/examples/_src/args/cast.erb.rb +4 -0
- data/examples/_src/args/opts.erb.rb +4 -0
- data/examples/_src/args/required.erb.rb +2 -0
- data/examples/_src/gem.erb.rb +4 -0
- data/examples/_src/readme/abstract.erb.rb +2 -0
- data/examples/_src/readme/alias.erb.rb +2 -0
- data/examples/_src/readme/arg.erb.rb +2 -0
- data/examples/_src/readme/arg_array.erb.rb +2 -0
- data/examples/_src/readme/arg_type.erb.rb +2 -0
- data/examples/_src/readme/args_splat.erb.rb +6 -0
- data/examples/_src/readme/array.erb.rb +2 -0
- data/examples/_src/readme/basic.erb.rb +2 -0
- data/examples/_src/readme/default.erb.rb +2 -0
- data/examples/_src/readme/deprecated.erb.rb +2 -0
- data/examples/_src/readme/deprecated_alias.erb.rb +2 -0
- data/examples/_src/readme/description.erb.rb +2 -0
- data/examples/_src/readme/downcase.erb.rb +2 -0
- data/examples/_src/readme/enum.erb.rb +2 -0
- data/examples/_src/readme/example.erb.rb +2 -0
- data/examples/_src/readme/format.erb.rb +2 -0
- data/examples/_src/readme/internal.erb.rb +2 -0
- data/examples/_src/readme/negate.erb.rb +2 -0
- data/examples/_src/readme/note.erb.rb +2 -0
- data/examples/_src/readme/opts.erb.rb +2 -0
- data/examples/_src/readme/opts_block.erb.rb +2 -0
- data/examples/_src/readme/range.erb.rb +2 -0
- data/examples/_src/readme/registry.erb.rb +2 -0
- data/examples/_src/readme/required.erb.rb +2 -0
- data/examples/_src/readme/requireds.erb.rb +2 -0
- data/examples/_src/readme/requires.erb.rb +2 -0
- data/examples/_src/readme/secret.erb.rb +2 -0
- data/examples/_src/readme/see.erb.rb +2 -0
- data/examples/_src/readme/type.erb.rb +2 -0
- data/examples/args/cast +4 -0
- data/examples/args/opts +4 -0
- data/examples/args/required +2 -0
- data/examples/gem +4 -0
- data/examples/readme/abstract +2 -0
- data/examples/readme/alias +2 -0
- data/examples/readme/arg +2 -0
- data/examples/readme/arg_array +2 -0
- data/examples/readme/arg_type +2 -0
- data/examples/readme/args_splat +6 -0
- data/examples/readme/array +2 -0
- data/examples/readme/basic +2 -0
- data/examples/readme/default +2 -0
- data/examples/readme/deprecated +2 -0
- data/examples/readme/deprecated_alias +2 -0
- data/examples/readme/description +2 -0
- data/examples/readme/downcase +2 -0
- data/examples/readme/enum +2 -0
- data/examples/readme/example +2 -0
- data/examples/readme/format +2 -0
- data/examples/readme/internal +2 -0
- data/examples/readme/negate +2 -0
- data/examples/readme/note +2 -0
- data/examples/readme/opts +2 -0
- data/examples/readme/opts_block +2 -0
- data/examples/readme/range +2 -0
- data/examples/readme/registry +2 -0
- data/examples/readme/required +2 -0
- data/examples/readme/requireds +2 -0
- data/examples/readme/requires +2 -0
- data/examples/readme/secret +2 -0
- data/examples/readme/see +2 -0
- data/examples/readme/type +2 -0
- data/lib/cl/cmd.rb +2 -1
- data/lib/cl/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78ff40e295fbf8f2e46de7150e9e769c9d27311e
|
4
|
+
data.tar.gz: 230752a72d84226fe9c9dce2153e5eee317e5039
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dd2f41a992417486b560bacd083effdbc985a997ed136c2e0cf9d63467e3a4c997bcdfcfa19b2fdbef17a4223f16f919be305022a370929b00ce7258d8afbbb
|
7
|
+
data.tar.gz: 4ff8c46ee20c9a5e06f74c44e152aba5323ee24b12b7d3e1620362fc295cb1bc4b330b03e5088eb3bc379c4ae7e0f073ec1d7cdee3c034c3c0f58d4fad56767b
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -53,6 +53,8 @@ on CI.
|
|
53
53
|
```ruby
|
54
54
|
module Owners
|
55
55
|
class Add < Cl::Cmd
|
56
|
+
register :add
|
57
|
+
|
56
58
|
summary 'Add one or more owners to an existing owner group'
|
57
59
|
|
58
60
|
description <<~str
|
@@ -128,9 +130,11 @@ For example:
|
|
128
130
|
```ruby
|
129
131
|
module Cmd
|
130
132
|
class One < Cl::Cmd
|
133
|
+
register :one
|
131
134
|
end
|
132
135
|
|
133
136
|
class Two < Cl::Cmd
|
137
|
+
register :two
|
134
138
|
end
|
135
139
|
end
|
136
140
|
|
@@ -139,9 +143,7 @@ p Cl::Cmd[:two] # => Cmd::Two
|
|
139
143
|
|
140
144
|
```
|
141
145
|
|
142
|
-
Commands
|
143
|
-
their class name (as seen in the example above). It is possible to ovewrite this
|
144
|
-
key by manually registering the class, like so:
|
146
|
+
Commands can be registered like so:
|
145
147
|
|
146
148
|
```ruby
|
147
149
|
module One
|
@@ -151,13 +153,6 @@ module One
|
|
151
153
|
end
|
152
154
|
```
|
153
155
|
|
154
|
-
Be aware that if you derive a common base command class from `Cl::Cmd` it
|
155
|
-
should be declared as `abstract` in order to unregister itself from the command
|
156
|
-
registry.
|
157
|
-
|
158
|
-
This will prevent the runner to consider it as a runnable command, and omit it
|
159
|
-
from help output. See [abstract](#abstract) for details.
|
160
|
-
|
161
156
|
### Runners
|
162
157
|
|
163
158
|
Runners lookup the command to execute from the registry, by checking the
|
@@ -269,6 +264,8 @@ The description, summary, and examples are used in the help output.
|
|
269
264
|
```ruby
|
270
265
|
module Owners
|
271
266
|
class Add < Cl::Cmd
|
267
|
+
register :add
|
268
|
+
|
272
269
|
summary 'Add one or more owners to an existing owner group'
|
273
270
|
|
274
271
|
description <<~str
|
@@ -333,6 +330,8 @@ class Base < Cl::Cmd
|
|
333
330
|
end
|
334
331
|
|
335
332
|
class Add < Base
|
333
|
+
register :add
|
334
|
+
|
336
335
|
def run
|
337
336
|
puts 'Success'
|
338
337
|
end
|
@@ -365,6 +364,8 @@ example the method `ownsers` will be available on the `Cmd` instance:
|
|
365
364
|
|
366
365
|
```ruby
|
367
366
|
class Add < Cl::Cmd
|
367
|
+
register :add
|
368
|
+
|
368
369
|
arg :owner
|
369
370
|
|
370
371
|
def run
|
@@ -393,6 +394,8 @@ using this separator.
|
|
393
394
|
|
394
395
|
```ruby
|
395
396
|
class Add < Cl::Cmd
|
397
|
+
register :add
|
398
|
+
|
396
399
|
arg :owners, type: :array, sep: ','
|
397
400
|
|
398
401
|
def run
|
@@ -412,6 +415,8 @@ Other types cast the given argument to the expected Ruby type.
|
|
412
415
|
|
413
416
|
```ruby
|
414
417
|
class Cmd < Cl::Cmd
|
418
|
+
register :cmd
|
419
|
+
|
415
420
|
arg :one, type: :integer
|
416
421
|
arg :two, type: :float
|
417
422
|
arg :three, type: :boolean
|
@@ -437,6 +442,8 @@ For example:
|
|
437
442
|
|
438
443
|
```ruby
|
439
444
|
class Lft < Cl::Cmd
|
445
|
+
register :lft
|
446
|
+
|
440
447
|
arg :a, type: :array, splat: true
|
441
448
|
arg :b
|
442
449
|
arg :c
|
@@ -447,6 +454,8 @@ class Lft < Cl::Cmd
|
|
447
454
|
end
|
448
455
|
|
449
456
|
class Mid < Cl::Cmd
|
457
|
+
register :mid
|
458
|
+
|
450
459
|
arg :a
|
451
460
|
arg :b, type: :array, splat: true
|
452
461
|
arg :c
|
@@ -457,6 +466,8 @@ class Mid < Cl::Cmd
|
|
457
466
|
end
|
458
467
|
|
459
468
|
class Rgt < Cl::Cmd
|
469
|
+
register :rgt
|
470
|
+
|
460
471
|
arg :a
|
461
472
|
arg :b
|
462
473
|
arg :c, type: :array, splat: true
|
@@ -498,6 +509,8 @@ For example:
|
|
498
509
|
|
499
510
|
```ruby
|
500
511
|
class Add < Cl::Cmd
|
512
|
+
register :add
|
513
|
+
|
501
514
|
opt '--to GROUP', 'Target group to add owners to'
|
502
515
|
|
503
516
|
def run
|
@@ -532,6 +545,8 @@ the command.
|
|
532
545
|
|
533
546
|
```ruby
|
534
547
|
class Add < Cl::Cmd
|
548
|
+
register :add
|
549
|
+
|
535
550
|
# depending on its arity the block can receive:
|
536
551
|
#
|
537
552
|
# * value
|
@@ -562,6 +577,8 @@ Options can have one or many alias names, given as a Symbol or Array of Symbols:
|
|
562
577
|
|
563
578
|
```ruby
|
564
579
|
class Add < Cl::Cmd
|
580
|
+
register :add
|
581
|
+
|
565
582
|
opt '--to GROUP', alias: :group
|
566
583
|
|
567
584
|
def run
|
@@ -586,6 +603,8 @@ I.e. this value is going to be used if the user does not provide the option:
|
|
586
603
|
|
587
604
|
```ruby
|
588
605
|
class Add < Cl::Cmd
|
606
|
+
register :add
|
607
|
+
|
589
608
|
opt '--to GROUP', default: 'default'
|
590
609
|
|
591
610
|
def run
|
@@ -609,6 +628,8 @@ For a deprecated option:
|
|
609
628
|
|
610
629
|
```ruby
|
611
630
|
class Add < Cl::Cmd
|
631
|
+
register :add
|
632
|
+
|
612
633
|
opt '--target GROUP', deprecated: 'Deprecated.'
|
613
634
|
|
614
635
|
def run
|
@@ -628,6 +649,8 @@ For a deprecated option alias name:
|
|
628
649
|
|
629
650
|
```ruby
|
630
651
|
class Add < Cl::Cmd
|
652
|
+
register :add
|
653
|
+
|
631
654
|
opt '--to GROUP', alias: :target, deprecated: :target
|
632
655
|
|
633
656
|
def run
|
@@ -651,6 +674,8 @@ For example:
|
|
651
674
|
|
652
675
|
```ruby
|
653
676
|
class Add < Cl::Cmd
|
677
|
+
register :add
|
678
|
+
|
654
679
|
opt '--to GROUP', downcase: true
|
655
680
|
|
656
681
|
def run
|
@@ -677,6 +702,8 @@ For example:
|
|
677
702
|
|
678
703
|
```ruby
|
679
704
|
class Add < Cl::Cmd
|
705
|
+
register :add
|
706
|
+
|
680
707
|
opt '--to GROUP', enum: %w(one two)
|
681
708
|
|
682
709
|
def run
|
@@ -711,6 +738,8 @@ Options can have examples that will be printed in the help output.
|
|
711
738
|
|
712
739
|
```ruby
|
713
740
|
class Add < Cl::Cmd
|
741
|
+
register :add
|
742
|
+
|
714
743
|
opt '--to GROUP', example: 'group-one'
|
715
744
|
end
|
716
745
|
|
@@ -738,6 +767,8 @@ For example:
|
|
738
767
|
|
739
768
|
```ruby
|
740
769
|
class Add < Cl::Cmd
|
770
|
+
register :add
|
771
|
+
|
741
772
|
opt '--to GROUP', format: /^\w+$/
|
742
773
|
|
743
774
|
def run
|
@@ -774,6 +805,8 @@ For example:
|
|
774
805
|
|
775
806
|
```ruby
|
776
807
|
class Add < Cl::Cmd
|
808
|
+
register :add
|
809
|
+
|
777
810
|
opt '--to GROUP'
|
778
811
|
opt '--hidden', internal: true
|
779
812
|
end
|
@@ -803,6 +836,8 @@ For example:
|
|
803
836
|
|
804
837
|
```ruby
|
805
838
|
class Add < Cl::Cmd
|
839
|
+
register :add
|
840
|
+
|
806
841
|
opt '--retries COUNT', type: :integer, min: 1, max: 5
|
807
842
|
|
808
843
|
def run
|
@@ -840,6 +875,8 @@ an option `negate` like so:
|
|
840
875
|
|
841
876
|
```ruby
|
842
877
|
class Add < Cl::Cmd
|
878
|
+
register :add
|
879
|
+
|
843
880
|
opt '--notifications', 'Send out notifications to the team', negate: %w(skip)
|
844
881
|
|
845
882
|
def run
|
@@ -885,6 +922,8 @@ Options can have a note that will be printed in the help output.
|
|
885
922
|
|
886
923
|
```ruby
|
887
924
|
class Add < Cl::Cmd
|
925
|
+
register :add
|
926
|
+
|
888
927
|
opt '--to GROUP', note: 'needs to be a group'
|
889
928
|
end
|
890
929
|
|
@@ -911,6 +950,8 @@ on this in order to, for example, obfuscate values from log output.
|
|
911
950
|
|
912
951
|
```ruby
|
913
952
|
class Add < Cl::Cmd
|
953
|
+
register :add
|
954
|
+
|
914
955
|
opt '--pass PASS', secret: true
|
915
956
|
|
916
957
|
def run
|
@@ -938,6 +979,8 @@ For example:
|
|
938
979
|
|
939
980
|
```ruby
|
940
981
|
class Add < Cl::Cmd
|
982
|
+
register :add
|
983
|
+
|
941
984
|
opt '--to GROUP', see: 'https://docs.io/cli/owners/add'
|
942
985
|
end
|
943
986
|
|
@@ -965,6 +1008,8 @@ only supports arrays of strings).
|
|
965
1008
|
|
966
1009
|
```ruby
|
967
1010
|
class Add < Cl::Cmd
|
1011
|
+
register :add
|
1012
|
+
|
968
1013
|
opt '--to GROUP', type: :array
|
969
1014
|
|
970
1015
|
def run
|
@@ -984,6 +1029,8 @@ Other types cast the given value to the expected Ruby type.
|
|
984
1029
|
|
985
1030
|
```ruby
|
986
1031
|
class Add < Cl::Cmd
|
1032
|
+
register :add
|
1033
|
+
|
987
1034
|
opt '--active BOOL', type: :boolean
|
988
1035
|
opt '--retries INT', type: :integer
|
989
1036
|
opt '--sleep FLOAT', type: :float
|
@@ -1013,6 +1060,8 @@ For example, this simply requires the option `--to`:
|
|
1013
1060
|
|
1014
1061
|
```ruby
|
1015
1062
|
class Add < Cl::Cmd
|
1063
|
+
register :add
|
1064
|
+
|
1016
1065
|
opt '--to GROUP', required: true
|
1017
1066
|
|
1018
1067
|
def run
|
@@ -1045,6 +1094,8 @@ This will make the option `--retries` depend on the option `--to`:
|
|
1045
1094
|
|
1046
1095
|
```ruby
|
1047
1096
|
class Add < Cl::Cmd
|
1097
|
+
register :add
|
1098
|
+
|
1048
1099
|
opt '--to GROUP'
|
1049
1100
|
opt '--other GROUP', requires: :to
|
1050
1101
|
|
@@ -1080,6 +1131,8 @@ This requires either the option `--api_key` or both options `--username` and
|
|
1080
1131
|
|
1081
1132
|
```ruby
|
1082
1133
|
class Add < Cl::Cmd
|
1134
|
+
register :add
|
1135
|
+
|
1083
1136
|
# read DNF, i.e. "token OR user AND pass
|
1084
1137
|
required :token, [:user, :pass]
|
1085
1138
|
|
@@ -6,6 +6,8 @@ $: << File.expand_path('lib')
|
|
6
6
|
|
7
7
|
module Cast
|
8
8
|
class Bool < Cl::Cmd
|
9
|
+
register :bool
|
10
|
+
|
9
11
|
arg :bool, type: :bool
|
10
12
|
|
11
13
|
def run
|
@@ -14,6 +16,8 @@ $: << File.expand_path('lib')
|
|
14
16
|
end
|
15
17
|
|
16
18
|
class Types < Cl::Cmd
|
19
|
+
register :types
|
20
|
+
|
17
21
|
arg :a, type: :bool
|
18
22
|
arg :b, type: :int
|
19
23
|
arg :c, type: :float
|
@@ -6,6 +6,8 @@ $: << File.expand_path('lib')
|
|
6
6
|
|
7
7
|
module Opts
|
8
8
|
class Bool < Cl::Cmd
|
9
|
+
register :bool
|
10
|
+
|
9
11
|
arg :bool, type: :bool
|
10
12
|
|
11
13
|
def run
|
@@ -14,6 +16,8 @@ $: << File.expand_path('lib')
|
|
14
16
|
end
|
15
17
|
|
16
18
|
class Types < Cl::Cmd
|
19
|
+
register :types
|
20
|
+
|
17
21
|
arg :a, type: :bool
|
18
22
|
arg :b, type: :int
|
19
23
|
arg :c, type: :float
|
data/examples/_src/gem.erb.rb
CHANGED
@@ -8,6 +8,8 @@ $: << File.expand_path('lib')
|
|
8
8
|
module Release
|
9
9
|
module Cmds
|
10
10
|
class Release < Cl::Cmd
|
11
|
+
register 'release'
|
12
|
+
|
11
13
|
arg :gemspec
|
12
14
|
|
13
15
|
opt '-h', '--host HOST', 'Push to a compatible host other than rubygems.org'
|
@@ -20,6 +22,8 @@ $: << File.expand_path('lib')
|
|
20
22
|
end
|
21
23
|
|
22
24
|
class Bump < Cl::Cmd
|
25
|
+
register 'bump'
|
26
|
+
|
23
27
|
opt '-v', '--version VERSION', 'The version to bump to [1.1.1|major|minor|patch|pre|rc|release]'
|
24
28
|
opt '--[no-]commit', 'Bump the version, but do not commit'
|
25
29
|
|
@@ -5,6 +5,8 @@ $: << File.expand_path('lib')
|
|
5
5
|
require 'cl'
|
6
6
|
|
7
7
|
class Lft < Cl::Cmd
|
8
|
+
register :lft
|
9
|
+
|
8
10
|
arg :a, type: :array, splat: true
|
9
11
|
arg :b
|
10
12
|
arg :c
|
@@ -15,6 +17,8 @@ $: << File.expand_path('lib')
|
|
15
17
|
end
|
16
18
|
|
17
19
|
class Mid < Cl::Cmd
|
20
|
+
register :mid
|
21
|
+
|
18
22
|
arg :a
|
19
23
|
arg :b, type: :array, splat: true
|
20
24
|
arg :c
|
@@ -25,6 +29,8 @@ $: << File.expand_path('lib')
|
|
25
29
|
end
|
26
30
|
|
27
31
|
class Rgt < Cl::Cmd
|
32
|
+
register :rgt
|
33
|
+
|
28
34
|
arg :a
|
29
35
|
arg :b
|
30
36
|
arg :c, type: :array, splat: true
|
data/examples/args/cast
CHANGED
@@ -5,6 +5,8 @@ require 'cl'
|
|
5
5
|
|
6
6
|
module Cast
|
7
7
|
class Bool < Cl::Cmd
|
8
|
+
register :bool
|
9
|
+
|
8
10
|
arg :bool, type: :bool
|
9
11
|
|
10
12
|
def run
|
@@ -13,6 +15,8 @@ module Cast
|
|
13
15
|
end
|
14
16
|
|
15
17
|
class Types < Cl::Cmd
|
18
|
+
register :types
|
19
|
+
|
16
20
|
arg :a, type: :bool
|
17
21
|
arg :b, type: :int
|
18
22
|
arg :c, type: :float
|
data/examples/args/opts
CHANGED
@@ -5,6 +5,8 @@ require 'cl'
|
|
5
5
|
|
6
6
|
module Opts
|
7
7
|
class Bool < Cl::Cmd
|
8
|
+
register :bool
|
9
|
+
|
8
10
|
arg :bool, type: :bool
|
9
11
|
|
10
12
|
def run
|
@@ -13,6 +15,8 @@ module Opts
|
|
13
15
|
end
|
14
16
|
|
15
17
|
class Types < Cl::Cmd
|
18
|
+
register :types
|
19
|
+
|
16
20
|
arg :a, type: :bool
|
17
21
|
arg :b, type: :int
|
18
22
|
arg :c, type: :float
|
data/examples/args/required
CHANGED
data/examples/gem
CHANGED
@@ -7,6 +7,8 @@ module Gem
|
|
7
7
|
module Release
|
8
8
|
module Cmds
|
9
9
|
class Release < Cl::Cmd
|
10
|
+
register 'release'
|
11
|
+
|
10
12
|
arg :gemspec
|
11
13
|
|
12
14
|
opt '-h', '--host HOST', 'Push to a compatible host other than rubygems.org'
|
@@ -19,6 +21,8 @@ module Gem
|
|
19
21
|
end
|
20
22
|
|
21
23
|
class Bump < Cl::Cmd
|
24
|
+
register 'bump'
|
25
|
+
|
22
26
|
opt '-v', '--version VERSION', 'The version to bump to [1.1.1|major|minor|patch|pre|rc|release]'
|
23
27
|
opt '--[no-]commit', 'Bump the version, but do not commit'
|
24
28
|
|
data/examples/readme/abstract
CHANGED
data/examples/readme/alias
CHANGED
data/examples/readme/arg
CHANGED
data/examples/readme/arg_array
CHANGED
data/examples/readme/arg_type
CHANGED
data/examples/readme/args_splat
CHANGED
@@ -4,6 +4,8 @@ $: << File.expand_path('lib')
|
|
4
4
|
require 'cl'
|
5
5
|
|
6
6
|
class Lft < Cl::Cmd
|
7
|
+
register :lft
|
8
|
+
|
7
9
|
arg :a, type: :array, splat: true
|
8
10
|
arg :b
|
9
11
|
arg :c
|
@@ -14,6 +16,8 @@ class Lft < Cl::Cmd
|
|
14
16
|
end
|
15
17
|
|
16
18
|
class Mid < Cl::Cmd
|
19
|
+
register :mid
|
20
|
+
|
17
21
|
arg :a
|
18
22
|
arg :b, type: :array, splat: true
|
19
23
|
arg :c
|
@@ -24,6 +28,8 @@ class Mid < Cl::Cmd
|
|
24
28
|
end
|
25
29
|
|
26
30
|
class Rgt < Cl::Cmd
|
31
|
+
register :rgt
|
32
|
+
|
27
33
|
arg :a
|
28
34
|
arg :b
|
29
35
|
arg :c, type: :array, splat: true
|
data/examples/readme/array
CHANGED
data/examples/readme/basic
CHANGED
data/examples/readme/default
CHANGED
data/examples/readme/deprecated
CHANGED
data/examples/readme/description
CHANGED
data/examples/readme/downcase
CHANGED
data/examples/readme/enum
CHANGED
data/examples/readme/example
CHANGED
data/examples/readme/format
CHANGED
data/examples/readme/internal
CHANGED
data/examples/readme/negate
CHANGED
data/examples/readme/note
CHANGED
data/examples/readme/opts
CHANGED
data/examples/readme/opts_block
CHANGED
data/examples/readme/range
CHANGED
data/examples/readme/registry
CHANGED
data/examples/readme/required
CHANGED
data/examples/readme/requireds
CHANGED
data/examples/readme/requires
CHANGED
data/examples/readme/secret
CHANGED
data/examples/readme/see
CHANGED
data/examples/readme/type
CHANGED
data/lib/cl/cmd.rb
CHANGED
@@ -7,6 +7,7 @@ require 'cl/parser'
|
|
7
7
|
|
8
8
|
class Cl
|
9
9
|
singleton_class.send(:attr_accessor, :auto_register) # remove unless anyone needs this
|
10
|
+
singleton_class.instance_variable_set(:@auto_register, true)
|
10
11
|
|
11
12
|
# Base class for all command classes that can be run.
|
12
13
|
#
|
@@ -23,7 +24,7 @@ class Cl
|
|
23
24
|
include Merge, Suggest, Underscore
|
24
25
|
|
25
26
|
inherited = ->(const) do
|
26
|
-
return unless Cl.auto_register
|
27
|
+
# return unless Cl.auto_register
|
27
28
|
if const.name
|
28
29
|
key = underscore(const.name.split('::').last)
|
29
30
|
key = [registry_key, key].compact.join(':') unless abstract?
|
data/lib/cl/version.rb
CHANGED