contentful_bootstrap 1.3.0 → 1.3.1

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
  SHA1:
3
- metadata.gz: abc3293313734c48533d9bfab19a082c56ff2015
4
- data.tar.gz: 2f32362597921e36bde671c82e6ebc1ed9370b8d
3
+ metadata.gz: 0c8f5028be1c1d1e37215d532d158a66610aa4de
4
+ data.tar.gz: 7f84282c0791de5fc2d442a577e2eb2e972c4228
5
5
  SHA512:
6
- metadata.gz: cd662d667dbfa2ea5fedc5eba59e21c88a26a2178857b491ebf334232bf67e96bd3aefd7819f3d97d3752a52b4f58edb275292476684a185768aa9a7a3efc13f
7
- data.tar.gz: fecb3ebcc95412f4471f9836ac8767168b2f7f68319da4abad64718917809e62af6a1f21b3f16881100aae39b01aa2fddba68a60b0e9447988468e779561c5a7
6
+ metadata.gz: f06b2166edf6174bdd540f0cd20fab451813ac678480565a1717f815e6efd394b2ee963f964579094d97c4a805eb76a933430a1516a7b917226e43019404e5d5
7
+ data.tar.gz: 6b3b7ebaef6faee10ca617d9673dda15c8520dfe336308d09e6b43515699f9c5bf72c108f49dad3cbf1aca7308b623ae8805a8cb84743ccb00f3511d706e9400
@@ -1,6 +1,10 @@
1
1
  # Change Log
2
2
  ## Unreleased
3
3
 
4
+ ## v1.3.1
5
+ ### Fixed
6
+ * Fix help messages. [#5](https://github.com/contentful-labs/contentful-bootstrap.rb/issues/5)
7
+
4
8
  ## v1.3.0
5
9
  ### Added
6
10
  * Spaces now get their own section in `~/.contentfulrc`
@@ -17,7 +17,7 @@ end
17
17
  subcommands = {
18
18
  'create_space' => OptionParser.new do |opts|
19
19
  opts.banner = "Usage: init <space_name> [--template TEMPLATE_NAME] [--json-template JSON_PATH] [--config CONFIG_PATH]"
20
- opts.on("-t TEMPLATE", "--template TEMPLATE", "Specify Template", "blog, catalogue, gallery") do |t|
20
+ opts.on("-t TEMPLATE", "--template TEMPLATE", "Specify Template", "Available Templates: blog, catalogue, gallery") do |t|
21
21
  options[:template] = t
22
22
  end
23
23
  opts.on("-j JSON_PATH", "--json-template JSON_PATH", "Specify JSON Template Path") do |j|
@@ -26,27 +26,39 @@ subcommands = {
26
26
  opts.on("-c CONFIG_PATH", "--config CONFIG_PATH", "Specify Configuration Path") do |c|
27
27
  options[:config_path] = c
28
28
  end
29
+ opts.on_tail("-h", "--help", "Print this message") do
30
+ puts opts
31
+ end
29
32
  end,
30
33
  'generate_token' => OptionParser.new do |opts|
31
34
  opts.banner = "Usage: generate_token <space_id> [--name TOKEN_NAME] [--config CONFIG_PATH]"
32
- opts.on("-n NAME", "--name TEMPLATE", "Specify Token Name") do |n|
35
+ opts.on("-n NAME", "--name TOKEN_NAME", "Specify Token Name") do |n|
33
36
  options[:name] = n
34
37
  end
35
38
  opts.on("-c CONFIG_PATH", "--config CONFIG_PATH", "Specify Configuration Path") do |c|
36
39
  options[:config_path] = c
37
40
  end
41
+ opts.on_tail("-h", "--help", "Print this message") do
42
+ puts opts
43
+ end
38
44
  end
39
45
  }
40
46
 
41
47
  global.order!
42
48
  command = ARGV.shift
43
- space = ARGV.shift
49
+
50
+ is_help = ARGV.include?("-h") || ARGV.include?("--help")
51
+ space = ARGV.shift unless is_help
44
52
 
45
53
  if subcommands.has_key? command
46
54
  subcommands[command].order!
47
55
 
56
+ if is_help
57
+ exit
58
+ end
59
+
48
60
  if space.nil? || space.empty?
49
- puts "Usage: contentful_bootstrap <command> <space_name> [--template TEMPLATE_NAME]"
61
+ puts "Usage: contentful_bootstrap <command> <space> [options]"
50
62
  puts
51
63
  puts "You must provide a valid space name. Exiting!"
52
64
  exit
@@ -1,5 +1,5 @@
1
1
  module Contentful
2
2
  module Bootstrap
3
- VERSION = "1.3.0"
3
+ VERSION = "1.3.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Litvak Bruno