5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/view_server/runner.rb', line 5
def self.old_run
options = Clip do |p|
p.flag 's', 'server',:desc => 'Is a server', :default => false
p.optional 'p', 'port', :desc => 'The port', :default => 10021 do |v|
v.to_i
end
p.flag 'c', 'copy_to_clipboard', :desc => "Send to clipboard"
p.flag 'P', 'paste_from_clipboard', :desc => "Read from clipboard"
p.flag 'v', 'verbose', :desc => 'Make it chatty'
end
if options.valid?
if options.verbose?
puts options.host
puts options.port
puts 'files:'
options.files.each do |f|
puts "\t#{f}"
end
end
if options.server?
Server.serve(options)
else
Client.new(options.port).send(options)
end
else
$stderr.puts options.to_s
end
end
|