Sha256: 232b01e1679c6ba7ae2091dd7fac3ab07889984c51d0184c71923cf64b9d5aaa

Contents?: true

Size: 806 Bytes

Versions: 4

Compression:

Stored size: 806 Bytes

Contents

#!/usr/bin/env ruby -w

require "git_fame"
require "trollop"

sort = ["name", "commits", "loc", "files"]
opts = Trollop::options do
  version "git-fame #{GitFame::VERSION} (c) 2012 Linus Oleander"
  opt :repository, "What git repository should be used?", default: "."
  opt :sort, "What should the printed table be sorted by? #{sort.join(", ")}", default: "loc", type: String
  opt :progressbar, "Show progressbar during calculation", default: 1, type: Integer
end

Trollop::die :repository, "is not a git repository" unless GitFame::Base.git_repository?(opts[:repository])
Trollop::die :sort, "must be one of the following; #{sort.join(", ")}" unless sort.include?(opts[:sort])
GitFame::Base.new({
  repository: opts[:repository],
  progressbar: opts[:progressbar] == 1,
  sort: opts[:sort]
}).pretty_puts

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
git_fame-1.0.0 bin/git-fame
git_fame-0.1.2 bin/git-fame
git_fame-0.1.1 bin/git-fame
git_fame-0.1.0 bin/git-fame