Sha256: 86c29cd77f7a381e09d8242593f410db70a34a73373fe3a8bbc0a7c8a7aaf6e4

Contents?: true

Size: 1.4 KB

Versions: 3

Compression:

Stored size: 1.4 KB

Contents

#!/usr/bin/env ruby
require "rubygems"
require "optparse"

$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
require "organization_license_audit"

def git_config(thing)
  result = `git config #{thing}`.strip
  result.empty? ? nil : result
end

options = {
  :ignore => [],
  :user => git_config("github.user"),
  :whitelist => []
}
OptionParser.new do |parser|
  parser.banner = <<BANNER
Audit all licenses used by your github organization/user

Usage:
    organization-license-audit your-user-name

Options:
BANNER
  OrganizationAudit.optparse(parser, options)
  parser.on("--csv [SEPARATOR]", String, "Dump a csv summary") do |separator|
    separator ||= ","
    separator.sub!('\t', "\t") # passing tab is not easy, so be nice (useful for pasting in google spreadsheet)
    options[:csv] = separator
  end
  parser.on("--ignore-gems", "Ignore repos that have a %{repo}.gemspec") { options[:ignore_gems] = true }
  parser.on("--without TYPES", String, "Do not run for bundler/npm dependencies (comma separated)") { |without| options[:without] = without.split(",") }
  parser.on("-w", "--whitelist=LICENSES", String, "Comma separated list of licenses") { |whitelist| options[:whitelist] = whitelist.split(",") }
  parser.on("-h", "--help", "Show this.") { puts parser; exit }
  parser.on("-v", "--version", "Show Version"){ puts OrganizationLicenseAudit::VERSION; exit}
end.parse!

exit OrganizationLicenseAudit.run(options)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
organization_license_audit-1.0.5 bin/organization-license-audit
organization_license_audit-1.0.4 bin/organization-license-audit
organization_license_audit-1.0.3 bin/organization-license-audit