Class: Conjur::CLI
Class Method Summary collapse
- .apply_config ⇒ Object
-
.init! ⇒ Object
This makes our generate-commands script a little bit cleaner.
- .load_config ⇒ Object
- .load_plugins ⇒ Object
-
.run(args) ⇒ Object
Horible hack! We want to support legacy commands like host:list, but we don’t want to do too much effort, and GLIs support for aliasing doesn’t work out so well with subcommands.
Class Method Details
.apply_config ⇒ Object
48 49 50 |
# File 'lib/conjur/cli.rb', line 48 def apply_config Conjur::Config.apply end |
.init! ⇒ Object
This makes our generate-commands script a little bit cleaner. We can call this from that script to ensure that commands for all plugins are loaded.
77 78 79 80 81 82 83 |
# File 'lib/conjur/cli.rb', line 77 def init! subcommand_option_handling :normal load_config apply_config load_plugins commands_from 'conjur/command' end |
.load_config ⇒ Object
44 45 46 |
# File 'lib/conjur/cli.rb', line 44 def load_config Conjur::Config.load end |
.load_plugins ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/conjur/cli.rb', line 61 def load_plugins # These used to be plugins but now they are in the core CLI plugins = Conjur::Config.plugins - %w(layer pubkeys) plugins.each do |plugin| begin filename = "conjur-asset-#{plugin}" require filename rescue LoadError warn "Could not load plugin '#{plugin}' specified in your config file.\nMake sure you have the #{filename}-api gem installed." end end end |
.run(args) ⇒ Object
Horible hack! We want to support legacy commands like host:list, but we don’t want to do too much effort, and GLIs support for aliasing doesn’t work out so well with subcommands.
56 57 58 59 |
# File 'lib/conjur/cli.rb', line 56 def run args args = args.shift.split(':') + args unless args.empty? super args end |