screenxtv 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/screenxtv.rb +34 -3
  2. metadata +2 -2
data/lib/screenxtv.rb CHANGED
@@ -8,6 +8,27 @@ require 'optparse'
8
8
  require 'readline'
9
9
  require 'tempfile'
10
10
 
11
+ def showVersion
12
+ print "ScreenX TV Ruby Client 0.0.9\n"
13
+ exit
14
+ end
15
+ def showHelp
16
+ print <<EOS
17
+ Usage:
18
+ screenxtv [options]
19
+
20
+ Options:
21
+ -u, [--url]      # Select a url (e.g. yasulab, tompng)
22
+ -c, [--color]    # Select a color (options: black/white/green/novel)
23
+ -t, [--title]    # Select a title (e.g. Joe's Codestream)
24
+ -r, [--reset]    # Reset your default configuration (e.g. url, color, title)
25
+ -f CONFIG_FILE   # Path to a preset configuration
26
+ -p, [--private]  # Broadcast your terminal privately (anyone who has the link can access)
27
+ -h, [--help]     # Show this help message and quit
28
+ -v, [--version]  # Show ScreenX TV Ruby Client version number and quit
29
+ EOS
30
+ exit
31
+ end
11
32
  HOST="screenx.tv"
12
33
 
13
34
  def show_info(info)
@@ -135,11 +156,21 @@ parser=OptionParser.new do |op|
135
156
  op.on("-u [url]"){|v|argv[:url]=v||true}
136
157
  op.on("-c [color]"){|v|argv[:color]=v||true}
137
158
  op.on("-t [title]"){|v|argv[:title]=v||true}
138
- op.on("-reset"){|v|argv[:new]=true}
139
- op.on("-private"){|v|argv[:private]=true}
159
+ op.on("--reset"){|v|argv[:new]=true}
160
+ op.on("-p"){|v|argv[:private]=true}
161
+ op.on("--private"){|v|argv[:private]=true}
140
162
  op.on("-f config_file"){|v|argv[:file]=v}
163
+ op.on("-v"){showVersion}
164
+ op.on("--version"){showVersion}
165
+ op.on("-h"){showHelp}
166
+ op.on("--help"){showHelp}
167
+ end
168
+ begin
169
+ parser.parse(ARGV)
170
+ rescue
171
+ showHelp
172
+ exit
141
173
  end
142
- parser.parse(ARGV)
143
174
 
144
175
  conf_file=argv[:file] || "#{ENV['HOME']}/.screenxtv.yml"
145
176
  conf={}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: screenxtv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-11 00:00:00.000000000 Z
12
+ date: 2013-02-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json