bkmrq 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bkmrq/cli.rb +15 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 48c0dfa91f3487233e3c877fd903f7705a47ca7a6171500fbdd017ec7deb5fb1
4
- data.tar.gz: fee298953376725296f6f123011713e8c472a9439f2685a42ea50ab6a7556f1b
3
+ metadata.gz: 4ee67957af96bba18676779fe6cb3c818374720d6401483e3b5ff24a760a421b
4
+ data.tar.gz: 312c79e8cf2beb187bebcb1405bcb0e157d867a1fe07cfe4a37745a82920641a
5
5
  SHA512:
6
- metadata.gz: 5ab25db373d0fc5eb79e52788d26aa939e2b60551e55d803ed7c17fd6fb31388dd760494bb1accd43c2f999ed1635541f760ee86e1955c85549b4033519bb4e3
7
- data.tar.gz: 524ce82b859d53291fd831a02740ea2deb6b59694073ed37f9c202254c4f39d61ec5f1dcfd5c15d14068d319e3c6122c8ebdc9e4bed2bb3382eeef9b9eb0e72e
6
+ metadata.gz: 59cbd60d25856f3c89df44f84efe7f60c3faa3039dfebcca54f8f9865c848fddfd05f0f48bc0ecbd7a9276d4ea23dd2ee82b4a056618bf7d370cda3361800a0c
7
+ data.tar.gz: 91a1b4abaffe181f5af152b26b33a832cbdd364d5bca2f03e2e11b10ae4e4bfd2d9b7d02f4da52bda4ae4fa3e4215342ee5f7951b8687a7049e94f52aada3b48
data/lib/bkmrq/cli.rb CHANGED
@@ -11,14 +11,18 @@ module Bkmrq
11
11
  class Cli
12
12
  def initialize(args)
13
13
  @opts = {}
14
- option_parser.parse!(sanitize_args(args), into: @opts)
14
+ option_parser.parse!(default_args(sanitize_args(args)), into: @opts)
15
+ init_app if opts_valid?
16
+ end
17
+
18
+ private
19
+
20
+ def init_app
15
21
  Bkmrq::App.new(
16
22
  **@opts.slice(*Bkmrq::Manual.options_specs.map(&:last))
17
23
  ).export!
18
24
  end
19
25
 
20
- private
21
-
22
26
  def option_parser
23
27
  @option_parser ||= OptionParser.new do |args|
24
28
  # Option Parsing
@@ -36,5 +40,13 @@ module Bkmrq
36
40
  def sanitize_args(args)
37
41
  args.reject(&:empty?).map(&:scrub).map(&:split).flatten
38
42
  end
43
+
44
+ def default_args(args)
45
+ args.empty? ? ['-H'] : args
46
+ end
47
+
48
+ def opts_valid?
49
+ !@opts.key?(:help)
50
+ end
39
51
  end
40
52
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bkmrq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sreedev Kodichath