Optimist fails to provide a few conveniences, so we layer on a little bit of additional structure when defining our options.
config
.
Also, default
is a reserved name, hence defaultVal
.--help
.And set it all up with our key as the canonical option name.
In addition to the extended configuration that we desire, we also want special handling for generated values:
git config --list
provides information about branches and remotes - everything we need to
attempt to guess the project's GitHub repository.
There are several states that a GitHub-based repository could be in, and we've probably missed
a few. We attempt to guess it through a few means:
gh-pages
branch, chances are extremely high that its tracked
remote is the correct github project.A quick helper that extracts a GitHub project URL from its repository URL.
Command Line Helpers