Sha256: 39608158fb393669b6c1de0dd1ca2b4940f5d74e676c4c9f25c9c34a9be22dbc
Contents?: true
Size: 1014 Bytes
Versions: 1
Compression:
Stored size: 1014 Bytes
Contents
#!/usr/bin/env/ ruby require 'gitignore' require 'optparse' options = {} opt_parser = OptionParser.new do |opt| opt.banner = "Usage: gitignore NAMES_OF_TEMPLATES [OPTIONS]" opt.separator "" opt.separator "Example: gitignore android osx eclipse" # opt.separator "" # opt.separator "Commands" # opt.separator " list: prints all possible templates" opt.separator "" opt.separator "Options" opt.on("-h","--help","help") do options[:help] = true end opt.on("-o","--overwrite","overwrite the contents of existing gitignore file") do options[:overwrite] = true end opt.on("-l","--list","list: prints all possible templates") do options[:list] = true end end begin opt_parser.parse! ARGV rescue => err puts "Wrong arguments" Process.exit 1 end if (options.empty? and ARGV.empty?) or options[:help] puts opt_parser elsif options[:list] puts Gitignore::list_gitignore_files else puts Gitignore::create_gitignore(ARGV,options[:overwrite]) end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
gitignore-0.1.0 | bin/gitignore~ |