class KBSecret::CLI::Command::Generators

The implementation of `kbsecret generators`.

Public Class Methods

new(argv) click to toggle source
Calls superclass method KBSecret::CLI::Command::Abstract::new
# File lib/kbsecret/cli/command/generators.rb, line 8
        def initialize(argv)
          super(argv) do |cli|
            cli.slop do |o|
              o.banner = <<~HELP
                Usage:
                  kbsecret generators [options]
              HELP

              o.bool "-a", "--show-all", "show each generator in depth (i.e. metadata)"
            end
          end
        end

Public Instance Methods

run!() click to toggle source

@see Command::Abstract#run!

# File lib/kbsecret/cli/command/generators.rb, line 22
        def run!
          Config[:generators].each do |label, config|
            puts label

            next unless cli.opts.show_all?

            puts <<~DETAIL
              \tFormat: #{config[:format]}
              \tLength: #{config[:length]}
            DETAIL
          end
        end