lib/termup/cli.rb in termup-1.3.1 vs lib/termup/cli.rb in termup-2.0.0
- old
+ new
@@ -15,19 +15,27 @@
map 'c' => :create
map 'e' => :edit
map 'l' => :list
map 's' => :start
- desc 'create PROJECT', 'Create termup project (Shortcut: c)'
+ desc 'create PROJECT', 'Create termup project (Shortcut: c, Options: --iterm_basic / --iterm_advanced)'
+ method_option :iterm_basic, :type => :boolean, :required => false
+ method_option :iterm_advanced, :type => :boolean, :required => false
def create(project)
edit(project)
end
desc 'edit PROJECT', 'Edit termup project (Shortcut: e)'
def edit(project)
unless File.exists?(path(project))
empty_directory TERMUP_DIR
- template 'templates/template.yml', path(project)
+ if options['iterm_advanced']
+ template 'templates/iterm_advanced.yml', path(project)
+ elsif options['iterm_basic']
+ template 'templates/iterm_basic.yml', path(project)
+ else
+ template 'templates/template.yml', path(project)
+ end
end
say 'please set $EDITOR in ~/.bash_profile' and return unless editor = ENV['EDITOR']
system("#{editor} #{path(project)}")
end