Skip to content

simplifying the CLI #7

@rtsao

Description

@rtsao

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}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions