diff options
author | elijah <elijah@riseup.net> | 2016-06-29 13:59:51 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2016-07-01 14:48:42 -0700 |
commit | e03bfce9db2a213527beb16a4f4dd1f13d96be6e (patch) | |
tree | 9c97bdf1a8a23999a128e80dbe7a96552b354b2b | |
parent | 796b8893375adf3c178375e8f17f89f69f9f4fc8 (diff) |
leap cli: remove commands/util.rb (duplicate of common.rb)
-rw-r--r-- | lib/leap_cli/commands/util.rb | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/lib/leap_cli/commands/util.rb b/lib/leap_cli/commands/util.rb deleted file mode 100644 index e2dc03a0..00000000 --- a/lib/leap_cli/commands/util.rb +++ /dev/null @@ -1,49 +0,0 @@ -module LeapCli; module Commands - - extend self - extend LeapCli::Util - - 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 |