Skip to content

Commit 8dceb7a

Browse files
committed
better command line help
1 parent e9ec560 commit 8dceb7a

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

bin/w2m

+8-3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22

33
require 'word-to-markdown'
44

5-
if ARGV.size != 1
5+
if ARGV.size != 1 || ARGV[0] == "--help"
66
puts "Usage: bundle exec w2m path/to/document.docx"
77
exit 1
88
end
99

10-
doc = WordToMarkdown.new ARGV[0]
11-
puts doc.to_s
10+
if ARGV[0] == "--version"
11+
puts "WordToMarkdown v#{WordToMarkdown::VERSION}"
12+
puts "LibreOffice #{WordToMarkdown.soffice_version}"
13+
else
14+
doc = WordToMarkdown.new ARGV[0]
15+
puts doc.to_s
16+
end

script/cibuild

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -e
44

5+
bundle exec w2m --version
6+
57
bundle exec rake test
68

79
bundle exec gem build word-to-markdown.gemspec

0 commit comments

Comments
 (0)