Module: Dapp::CLI::Options::Tag

Class Method Summary collapse

Class Method Details

.extended(klass) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/dapp/cli/options/tag.rb', line 5

def self.extended(klass)
  klass.class_eval do
    "Add tag (can be used one or more times), specified text will be slugified".tap do |desc|
      option :tag,
              long: '--tag TAG',
              description: desc,
              default: [],
              proc: proc { |v| composite_options(:tags) << v }

      option :tag_slug,
              long: '--tag-slug TAG',
              description: desc,
              default: [],
              proc: proc { |v| composite_options(:slug_tags) << v }
    end

    option :tag_plain,
           long: '--tag-plain TAG',
           description: "Add tag (can be used one or more times)",
           default: [],
           proc: proc { |v| composite_options(:plain_tags) << v }

    option :tag_branch,
           long: '--tag-branch',
           description: 'Tag by git branch',
           boolean: true

    option :tag_build_id,
           long: '--tag-build-id',
           description: 'Tag by CI build id',
           boolean: true

    option :tag_ci,
           long: '--tag-ci',
           description: 'Tag by CI branch and tag',
           boolean: true

    option :tag_commit,
           long: '--tag-commit',
           description: 'Tag by git commit',
           boolean: true
  end
end