Sha256: 924464e74baeae1bfd7d906db29056fc9738d4ca6c2ade7a18fa011e104e53e4

Contents?: true

Size: 1.34 KB

Versions: 2

Compression:

Stored size: 1.34 KB

Contents

#!/usr/bin/env ruby

require 'qcmd'
require 'trollop'

VERSION_STRING =  "qcmd #{ Qcmd::VERSION } (c) 2012 Figure 53, Baltimore, MD."

opts = Trollop::options do
  version VERSION_STRING
  opt :verbose, 'Use verbose mode', :default => false
  opt :debug, "Show full debug output, don't make changes to workspaces", :default => false
  opt :machine, "Automatically try to connect to the machine with the given name", :type => :string
  opt :machine_passcode, "Use the given machine passcode", :type => :integer
  opt :workspace, "Automatically try to connect to the workspace with the given name", :type => :string
  opt :workspace_passcode, "Use the given workspace passcode", :type => :integer
  opt :command, "Execute a single command and exit", :type => :string
end

if opts[:verbose]
  Qcmd.log_level = :debug
end

if opts[:debug]
  Qcmd.log_level = :debug
  Qcmd.debug_mode = true
end

# browse local network and check for qlab + qlab workspaces

if !opts[:machine_given]
  Qcmd.ascii_qlab
  Qcmd.print
  Qcmd.print Qcmd.centered_text(VERSION_STRING)

  Qcmd::Network.browse_and_display opts
else
  Qcmd::Network.browse
end

if opts[:command_given] && !(opts[:machine_given] && opts[:workspace_given])
  Qcmd.print_wrapped("if you give a command, you must also give a
                      machine name and a workspace name to connect to")
end


Qcmd::CLI.launch opts

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
qcmd-0.1.7 bin/qcmd
qcmd-0.1.6 bin/qcmd