class Wagn::Commands::Command

Public Instance Methods

exit_with_child_status(command) click to toggle source
# File lib/wagn/commands/command.rb, line 9
def exit_with_child_status command
  command += " 2>&1"
  exit $CHILD_STATUS.exitstatus unless system command
end
run() click to toggle source
# File lib/wagn/commands/command.rb, line 4
def run
  puts command
  exit_with_child_status command
end
split_args(args) click to toggle source

split special wagn args and original command args separated by '–'

# File lib/wagn/commands/command.rb, line 15
def split_args args
  before_split = true
  wagn_args, command_args =
    args.partition do |a|
      before_split = (a == "--" ? false : before_split)
    end
  command_args.shift
  [wagn_args, command_args]
end