eac_cli 0.2.0 → 0.3.0

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: 6b98571e3ddcf2aadd402f64e364a7d7d3bfc189711b5ff1e696398d1e90457b
4
- data.tar.gz: 86698287a397dc5b8ef798dbbe9aca96247cf68033114bdd2c71e002e6afc8de
3
+ metadata.gz: 4623c36926e95a6f0e5a6aa6e311b2d2e1df28b18c31c500689864e6897f5c94
4
+ data.tar.gz: 509b39644f9d0f6c47d6e5403289b7220c0863cd0233fe38694a25b5fdae6bb2
5
5
  SHA512:
6
- metadata.gz: 006fa8fb408649d4654e05cde6cff39ef0ac30664761688cf3daf458d27dfee36e70f89abcaee26fe9154a4308b2ca53f190cb53a8af1d4275f74f693428a940
7
- data.tar.gz: '096ff1ae52b3765fa5f976489d41ef7b47f646b9c5bd18e0f7c891b95bb5c05283eb21c83e93cd516af2e1514877a52f22971f87b185261193192f3f61b885b2'
6
+ metadata.gz: c8c1a71998152f7b02211b40c5604b9506fb4dd644f1113b41b89a0b7139eba3a48da83f157c5499f54d1685f31f876317ec473ae1517367d794a82652f5e250
7
+ data.tar.gz: 86e4e7692ae833da2ceae78487bc4764aed954a44a57f5720c6158fad0b26ec5508c6a523d554788ed8eabde8aaf7451c84d435bb14540a309b79aa1bde226ef
@@ -55,6 +55,10 @@ module EacCli
55
55
  def positional
56
56
  @positional ||= []
57
57
  end
58
+
59
+ def subcommands
60
+ positional << PositionalArgument.new('subcommand', subcommand: true)
61
+ end
58
62
  end
59
63
  end
60
64
  end
@@ -13,9 +13,14 @@ module EacCli
13
13
  OPTION_DESC_SEP = IDENT * 2
14
14
 
15
15
  def positional_argument(positional)
16
- r = "<#{positional.name}>"
17
- r += '...' if positional.repeat?
18
- r
16
+ if positional.subcommand?
17
+ ::EacRubyUtils::Console::DocoptRunner::SUBCOMMANDS_MACRO
18
+ else
19
+ r = "<#{positional.name}>"
20
+ r += '...' if positional.repeat?
21
+ r = "[#{r}]" if positional.optional?
22
+ r
23
+ end
19
24
  end
20
25
 
21
26
  def option_argument(option)
@@ -7,9 +7,17 @@ module EacCli
7
7
  class PositionalArgument
8
8
  common_constructor :name, :options, default: [{}]
9
9
 
10
+ def optional?
11
+ options[:optional]
12
+ end
13
+
10
14
  def repeat?
11
15
  options[:repeat]
12
16
  end
17
+
18
+ def subcommand?
19
+ options[:subcommand]
20
+ end
13
21
  end
14
22
  end
15
23
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacCli
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eac_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-10 00:00:00.000000000 Z
11
+ date: 2020-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eac_ruby_utils