diff options
author | elijah <elijah@riseup.net> | 2015-08-18 11:58:05 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2015-08-18 11:58:05 -0700 |
commit | ed604349a4035eed2bccefa9aa030d93ad4f6b58 (patch) | |
tree | 333a6c5335f25935be13c1ffed82b8cc7c293df8 /lib/leap_cli/commands/util.rb | |
parent | cde4ae067e034e3969629f4d8da4f46daae3c351 (diff) |
moved commands to leap_platform
Diffstat (limited to 'lib/leap_cli/commands/util.rb')
-rw-r--r-- | lib/leap_cli/commands/util.rb | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/lib/leap_cli/commands/util.rb b/lib/leap_cli/commands/util.rb deleted file mode 100644 index c1da570..0000000 --- a/lib/leap_cli/commands/util.rb +++ /dev/null @@ -1,50 +0,0 @@ -module LeapCli; module Commands - - extend self - extend LeapCli::Util - extend LeapCli::Util::RemoteCommand - - def path(name) - Path.named_path(name) - end - - # - # keeps prompting the user for a numbered choice, until they pick a good one or bail out. - # - # block is yielded and is responsible for rendering the choices. - # - def numbered_choice_menu(msg, items, &block) - while true - say("\n" + msg + ':') - items.each_with_index &block - say("q. quit") - index = ask("number 1-#{items.length}> ") - if index.empty? - next - elsif index =~ /q/ - bail! - else - i = index.to_i - 1 - if i < 0 || i >= items.length - bail! - else - return i - end - end - end - end - - - def parse_node_list(nodes) - if nodes.is_a? Config::Object - Config::ObjectList.new(nodes) - elsif nodes.is_a? Config::ObjectList - nodes - elsif nodes.is_a? String - manager.filter!(nodes) - else - bail! "argument error" - end - end - -end; end |