Class: CF::UAA::Cli
Class Method Summary collapse
- .configure(config_file = "", input = $stdin, output = $stdout, print_on_trace = false) ⇒ Object
- .handle_bad_command(args, msg) ⇒ Object
- .preprocess_options(args, opts) ⇒ Object
- .uaa_info_client(url = Config.target) ⇒ Object
Methods inherited from BaseCli
Class Method Details
.configure(config_file = "", input = $stdin, output = $stdout, print_on_trace = false) ⇒ Object
28 29 30 31 32 33 |
# File 'lib/cli/runner.rb', line 28 def self.configure(config_file = "", input = $stdin, output = $stdout, print_on_trace = false) @config_file, @input, @output = config_file, input, output @print_on_trace = print_on_trace self end |
.handle_bad_command(args, msg) ⇒ Object
35 36 37 38 39 |
# File 'lib/cli/runner.rb', line 35 def self.handle_bad_command(args, msg) @output.puts "\n#{msg}" run args.unshift("help") nil end |
.preprocess_options(args, opts) ⇒ Object
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/cli/runner.rb', line 41 def self.(args, opts) return args.replace(["version"]) if opts[:version] return args.unshift("help") if args.empty? || opts[:help] && args[0] != "version" Config.load(opts[:config] || @config_file) if opts.key?(:config) || !Config.loaded? [:trace, :debug].each do |k| opts[k] = true if !opts.key?(k) && Config.target && Config.context && Config.value(k) end @uaa_logger = Util.default_logger(opts[:trace]? :trace: opts[:debug]? :debug: :warn, @output) end |