Class: TreeRepl::Cat

Inherits:
Cmd
  • Object
show all
Defined in:
lib/treerepl/cmds.rb

Instance Attribute Summary

Attributes inherited from Cmd

#name, #repl

Instance Method Summary collapse

Constructor Details

#initialize(repl) ⇒ Cat

Returns a new instance of Cat.



134
135
136
# File 'lib/treerepl/cmds.rb', line 134

def initialize(repl)
  super(repl,'cat')
end

Instance Method Details

#exec(args) ⇒ Object



140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/treerepl/cmds.rb', line 140

def exec(args)
  if args.empty?
    STDERR.put 'Required argument'
    return
  end
  args.each do |arg|
    n = repl.eval_path repl.cur,arg
    if n.kind_of? NamedNode
      p n.obj
    else
      STDERR.puts "Uh, not with this node #{n}"
    end
  end
end

#helpObject



137
138
139
# File 'lib/treerepl/cmds.rb', line 137

def help
  'Shows the contents of whatever it is you selected'
end