Sha256: 37c4b9bd98baf90cb5eff295e8f453a88c2b31bfac2850ab6b315bb83e682833
Contents?: true
Size: 556 Bytes
Versions: 13
Compression:
Stored size: 556 Bytes
Contents
require 'p4util/version' require 'commands' require 'optparse' require 'ostruct' module P4Util def P4Util.run(args) options = parse_options(args) Commands.method(options.command).call(options) end # Returns the options as an OpenStruct object def P4Util.parse_options(args) options = OpenStruct.new options.command = :help options.params = [] if args && !args.empty? options.command = args.first.to_sym if args.length > 1 options.params.concat(args.drop(1)) end end options end end
Version data entries
13 entries across 13 versions & 1 rubygems