bin/hoc in hoc-0.7.3 vs bin/hoc in hoc-0.8

- old
+ new

@@ -30,31 +30,28 @@ args = [] args.concat(File.read('.hoc').split(/\s+/).map(&:strip)) if File.exist?('.hoc') args.concat(ARGV) -opts = Slop.parse(args, strict: true, help: true) do - banner "Usage (#{HOC::VERSION}): hoc [options]" - on( - 'f', - 'format', +opts = Slop.parse(args, strict: true, help: true) do |o| + o.banner = "Usage (#{HOC::VERSION}): hoc [options]" + o.bool '-h', '--help', 'Show brief intro' + o.string( + '-f', + '--format', 'Output format (text|xml|json|int)', - default: 'int', - argument: :required + default: 'int' ) - on( - 'e', - 'exclude', - 'Glob pattern to exclude files/dirs, e.g. "vendor/**"', - as: Array, - argument: :required + o.array( + '-e', + '--exclude', + 'Glob pattern to exclude files/dirs, e.g. "vendor/**"' ) - on( - 'd', - 'dir', + o.string( + '-d', + '--dir', 'Directory to scan', - default: '.', - argument: :required + default: '.' ) end if opts.help? puts opts