Permalink
Browse files

add in option to --use a set of scrolls from history

  • Loading branch information...
1 parent 9360687 commit b80a37454a09ee0a61031eecd3fc8f101a0fac8e @jackdempsey committed May 1, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/appscrolls/command.rb
@@ -31,6 +31,7 @@ def new(name)
desc "history", "view history of past scroll choices"
method_option :save, :desc => "Save a past choice of scrolls to a new scroll."
+ method_option :use, :desc => "Directly use a past choice of scrolls to generate a new app."
def history
lines = File.readlines history_file
lines.each_with_index do |line, i|
@@ -40,6 +41,10 @@ def history
print "Enter line number and name to save to a new scroll (e.g. 1 my_defaults): "
index, name = STDIN.gets.strip.split(' ')
create_new_scroll(:scrolls => lines[index.to_i].chomp.split(' '), :name => name)
+ elsif options[:use]
+ print "Enter line number and name to create a new scroll from past selection (e.g. 1 new_app_name): "
+ index, name = STDIN.gets.strip.split(' ')
+ run_template(name, lines[index.to_i].chomp.split(' '))
end
end

0 comments on commit b80a374

Please sign in to comment.