matteosister/GitElephant — pull request #21 by davidneimeyer (2013-05-31 12:40:14+00:00)
Title: Implement git-remote command and 'show' and 'add' subcommands

This changeset introduces the Remote command:

Of Note, there are also changes to BaseCommand such that it's reasonable
to do more sophisticated things in the provided Command\SubCommandCommand
class and any Command\ class that intends on extending from this
new class.

Now, BaseCommand + SubCommandCommand introduces the concept of
passing a SubCommandCommand object to BaseCommand::addCommandSubject(),
which will be extracted to the appropriate string when
BaseCommand::getCommand() is called.

Technically speaking, SubCommandCommand wasn't a design requirment to
implement the remote command, provided some changes to BaseCommand were
made. However, having SubCommandCommand provides:
1) reasonable/minimal level of abstraction that emulates/models the git
cli more accurately.
2) provides more clarity for maintainers and implementors when building/
using subcommands.
3) provides more flexibility when constructing git cli commands which, at
times, be quirky for subcommands.
...it's debatable: maybe it should be a monolithic.

As well there's the concept of normalizing options when extending
BaseCommand such that you can:
1) validate implementer's options
2) as implementer/consumer, use the constant intead of the actually
option string argument (this puts more onus on maintainers of
GitElephant to track GIT cli, but it should be better for consumers)
3)potentially validate associated values with options in the future