Module: GitImproved

Defined in:
lib/git-improved.rb

Defined Under Namespace

Modules: ActionHelper Classes: AppHelpBuilder, GitAction, GitCommandFailed, GitConfig

Constant Summary collapse

VERSION =
ENVVAR_INITFILE =
"GI_INITFILE"
GIT_CONFIG =
GitConfig.new
APP_CONFIG =
Benry::CmdApp::Config.new("Git Improved", VERSION).tap do |c|
  c.option_topic          = true
  c.option_quiet          = true
  c.option_color          = true
  c.option_dryrun         = true
  c.format_option         = "  %-19s : %s"
  c.format_action         = "  %-19s : %s"
  c.backtrace_ignore_rexp = /\/gi(?:t-improved\.rb)?:/
  c.help_postamble        = {
    "Example:" => <<END,
$ mkdir mysample              # or: gi repo:clone github:<user>/<repo>
$ cd mysample
$ gi repo:init -u yourname -e [email protected]
$ vi README.md                   # create a new file
$ gi track README.md             # track files into the repository
$ gi cc "add README file"        # commit changes
$ vi README.md                   # update an existing file
$ gi stage .                     # add changes into staging area
$ gi staged                      # show changes in staging area
$ gi cc "update README file"     # commit changes
$ gi repo:remote:origin github:yourname/mysample   # set remote repo
$ gi push                        # upload local commits to remote repo
END
    "Document:" => "  https://kwatch.github.io/git-improved/",
  }
end

Class Method Summary collapse

Class Method Details

.main(argv = ARGV) ⇒ Object



1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
# File 'lib/git-improved.rb', line 1618

def self.main(argv=ARGV)
  errmsg = _load_init_file(ENV[ENVVAR_INITFILE])
  if errmsg
    $stderr.puts "\e[31m[ERROR]\e[0m #{errmsg}"
   return 1
  end
  #
  APP_CONFIG.default_action = GIT_CONFIG.default_action
  app_help_builder = AppHelpBuilder.new(APP_CONFIG)
  app = Benry::CmdApp::Application.new(APP_CONFIG, nil, app_help_builder)
  return app.main(argv)
end