Skip to content

Commit

Permalink
better command line help
Browse files Browse the repository at this point in the history
  • Loading branch information
benbalter committed Mar 21, 2015
1 parent e9ec560 commit 8dceb7a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bin/w2m
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

require 'word-to-markdown'

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

doc = WordToMarkdown.new ARGV[0]
puts doc.to_s
if ARGV[0] == "--version"
puts "WordToMarkdown v#{WordToMarkdown::VERSION}"
puts "LibreOffice #{WordToMarkdown.soffice_version}"
else
doc = WordToMarkdown.new ARGV[0]
puts doc.to_s
end
2 changes: 2 additions & 0 deletions script/cibuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e

bundle exec w2m --version

bundle exec rake test

bundle exec gem build word-to-markdown.gemspec

0 comments on commit 8dceb7a

Please sign in to comment.