diff --git a/CHANGELOG b/CHANGELOG index ee7a4b6a..f61136b9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ *SVN* -* Make the server definition itself available to SSH channels, rather that just the host name [Jamis Buck] +* Make `capify' understand simple command-line switches [Jamis Buck] + +* Make the server definition itself available to SSH channels, rather than just the host name [Jamis Buck] * Identify servers by their complete credentials in logs, rather than simply by hostname [Jamis Buck] diff --git a/bin/capify b/bin/capify index 650e56a0..8a7731d4 100755 --- a/bin/capify +++ b/bin/capify @@ -1,5 +1,24 @@ #!/usr/bin/env ruby +require 'optparse' + +OptionParser.new do |opts| + opts.banner = "Usage: #{File.basename($0)} [path]" + + opts.on("-h", "--help", "Displays this help info") do + puts opts + exit 0 + end + + begin + opts.parse!(ARGV) + rescue OptionParser::ParseError => e + warn e.message + puts opts + exit 1 + end +end + if ARGV.empty? abort "Please specify the directory to capify, e.g. `#{File.basename($0)} .'" elsif !File.exists?(ARGV.first)