File tree 5 files changed +16
-13
lines changed
5 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ README.txt
4
4
Rakefile
5
5
bin/docx2html
6
6
bin/docx2xml
7
- lib/version.rb
8
7
lib/ydocx.rb
9
8
lib/ydocx/builder.rb
10
9
lib/ydocx/document.rb
Original file line number Diff line number Diff line change 13
13
14
14
== Usage
15
15
16
- * Usage: /usr/local/ bin/docx2html file [options]
17
- -f, --format Format of style and chapter {(fi|fachinfo)|(pl|plain)}, default is FI .
16
+ * Usage: bin/docx2html file [options]
17
+ -f, --format Format of style and chapter {(fi|fachinfo)|(pi|patinfo)|( pl|plain)|none }, default fachinfo .
18
18
-h, --help Display this help message.
19
+ -v, --version Show version.
19
20
20
21
== Using the great libraries
21
22
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 4
4
require 'ydocx/document'
5
5
6
6
module YDocx
7
+ VERSION = '1.0.7'
7
8
end
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env ruby
2
2
# encoding: utf-8
3
3
4
- require 'ydocx/document '
4
+ require 'ydocx'
5
5
6
6
module YDocx
7
7
class Command
8
8
class << self
9
- @@help = /^\- (h|\- help)$/u
10
- @@format = /^\- (f|\- format)$/u
9
+ @@help = /^\- (h|\- help)$/u
10
+ @@format = /^\- (f|\- format)$/u
11
+ @@version = /^\- (v|\- version)$/u
11
12
def error ( message = '' )
12
13
puts message
13
14
puts "see `#{ self . command } --help`"
@@ -19,8 +20,9 @@ def command
19
20
def help
20
21
banner = <<-BANNER
21
22
Usage: #{ $0} file [options]
22
- -f, --format Format of style and chapter {(fi|fachinfo)|(pl|plain)|none}, default fachinfo.
23
+ -f, --format Format of style and chapter {(fi|fachinfo)|(pi|patinfo)|( pl|plain)|none}, default fachinfo.
23
24
-h, --help Display this help message.
25
+ -v, --version Show version.
24
26
BANNER
25
27
puts banner
26
28
exit
@@ -36,6 +38,8 @@ def run(action=:to_html)
36
38
argv = ARGV . dup
37
39
if argv . empty? or argv [ 0 ] =~ @@help
38
40
self . help
41
+ elsif argv [ 0 ] =~ @@version
42
+ self . version
39
43
else
40
44
file = argv . shift
41
45
path = File . expand_path ( file )
@@ -76,6 +80,10 @@ def run(action=:to_html)
76
80
end
77
81
end
78
82
end
83
+ def version
84
+ puts "#{ self . command } : version #{ VERSION } "
85
+ exit
86
+ end
79
87
end
80
88
end
81
89
end
You can’t perform that action at this time.
0 commit comments