L33T-KR3W / push-dir

👉📁 Push the contents of a directory to a remote branch
MIT License
267 stars 11 forks source link

simplifying the CLI #7

Open rtsao opened 8 years ago

rtsao commented 8 years ago

Since dir is a required option, I don't see the harm in making it the first argument (especially given the command name push-dir. The extra dir is redundant and I think actually harms readability and clarity)

push-dir --dir=build --branch=gh-pages
push-dir build --branch=gh-pages

Alternatively, I like this syntax:

push-dir build:gh-pages

Rationale:

  1. directory name is required
  2. branch name is required
  3. git branch names cannot contain :
  4. mimicks git push <remote_name> <local_branch_name>:<remote_branch_name> syntax

The whole point of this module is to basically push the contents of a folder as if it were a branch, so I think it makes sense.

We could even make it symmetric so we have:

push-dir {optional_remote_name} <local_dir_name>:<remote_branch_name> {advanced_options}

Unfortunately, directory names can contain colons, so maybe this is alternative is better:

push-dir build gh-pages {advanced_options}