Class: PROIEL::Commands::Shell
- Inherits:
-
PROIEL::Command
- Object
- PROIEL::Command
- PROIEL::Commands::Shell
- Defined in:
- lib/proiel/cli/commands/shell.rb
Class Method Summary collapse
Methods inherited from PROIEL::Command
Class Method Details
.init_with_program(prog) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/proiel/cli/commands/shell.rb', line 5 def init_with_program(prog) prog.command(:shell) do |c| c.syntax 'shell filename(s)' c.description 'Launch a shell with the treebank loaded' c.action do |args, | if args.empty? STDERR.puts 'Missing filename(s). Use --help for more information.' else process(args, ) end end end end |
.process(args, options) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/proiel/cli/commands/shell.rb', line 20 def process(args, ) tb = PROIEL::Treebank.new args.each do |filename| STDERR.puts "Reading #{filename}...".green if ['verbose'] tb.load_from_xml(filename) end binding.pry end |