aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands/util.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2012-10-21 16:17:05 -0700
committerelijah <elijah@riseup.net>2012-10-21 16:17:05 -0700
commit94dd3b4d99a67679adcc3a9921f9e1fa78783cba (patch)
tree537e0a290801c2783ab24eb5c932c44c0c7f7c86 /lib/leap_cli/commands/util.rb
parent338b3d97b8cb0f5fca0339514ffdfaf30cc65498 (diff)
downloadleap_cli-94dd3b4d99a67679adcc3a9921f9e1fa78783cba.tar.gz
leap_cli-94dd3b4d99a67679adcc3a9921f9e1fa78783cba.tar.bz2
added command init-node
Diffstat (limited to 'lib/leap_cli/commands/util.rb')
-rw-r--r--lib/leap_cli/commands/util.rb103
1 files changed, 6 insertions, 97 deletions
diff --git a/lib/leap_cli/commands/util.rb b/lib/leap_cli/commands/util.rb
index ad4f01c..b5a102f 100644
--- a/lib/leap_cli/commands/util.rb
+++ b/lib/leap_cli/commands/util.rb
@@ -2,11 +2,12 @@ module LeapCli
module Commands
extend self
extend LeapCli::Util
-# #
-# # 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.
-# #
+
+ #
+ # 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 + ':')
@@ -28,98 +29,6 @@ module LeapCli
end
end
-# #
-# # read a file, exit if the file doesn't exist.
-# #
-# def read_file!(file_path)
-# if !File.exists?(file_path)
-# bail!("File '%s' does not exist." % file_path)
-# else
-# File.readfile(file_path)
-# end
-# end
-
-# ##
-# ## LOGGING
-# ##
-
-# def log0(message=nil, &block)
-# if message
-# puts message
-# elsif block
-# puts yield(block)
-# end
-# end
-
-# def log1(message=nil, &block)
-# if LeapCli.log_level > 0
-# if message
-# puts message
-# elsif block
-# puts yield(block)
-# end
-# end
-# end
-
-# def log2(message=nil, &block)
-# if LeapCli.log_level > 1
-# if message
-# puts message
-# elsif block
-# puts yield(block)
-# end
-# end
-# end
-
-# def progress(message)
-# log1(" * " + message)
-# end
-
-# ##
-# ## QUITTING
-# ##
-
-# #
-# # quit and print help
-# #
-# def help!(message=nil)
-# ENV['GLI_DEBUG'] = "false"
-# help_now!(message)
-# #say("ERROR: " + message)
-# end
-
-# #
-# # quit with a message that we are bailing out.
-# #
-# def bail!(message="")
-# say(message)
-# say("Bailing out.")
-# raise SystemExit.new
-# #ENV['GLI_DEBUG'] = "false"
-# #exit_now!(message)
-# end
-
-# #
-# # quit with no message
-# #
-# def quit!(message='')
-# say(message)
-# raise SystemExit.new
-# end
-
-# #
-# # bails out with message if assertion is false.
-# #
-# def assert!(boolean, message)
-# bail!(message) unless boolean
-# end
-
-# #
-# # assert that the command is available
-# #
-# def assert_bin!(cmd_name)
-# assert! `which #{cmd_name}`.strip.any?, "Sorry, bailing out, the command '%s' is not installed." % cmd_name
-# end
end
end