Module: Dotcrypt::Cli::Commands::Show

Included in:
App
Defined in:
lib/dotcrypt/CLI/commands/show.rb

Defined Under Namespace

Classes: Handler

Class Method Summary collapse

Class Method Details

.included(thor) ⇒ Object

rubocop:disable Metrics/MethodLength



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/dotcrypt/CLI/commands/show.rb', line 4

def self.included(thor) # rubocop:disable Metrics/MethodLength
  thor.class_eval do
    include Dotcrypt::Cli::Commands::Globals

    desc "show", "converts a jsonnet file into various formats"

    option :output, aliases: :o,
                    type: :string,
                    enum: Dotcrypt::Serializers::SERIALIZERS.keys.map(&:to_s),
                    default: "yaml",
                    desc: "Output format."

    option :flatten, aliases: :l,
                     type: :boolean,
                     default: false,
                     desc: "Whether to flatten the output. Always enabled for `env` format"

    def show = Handler.new(**options).call
  end
end