Because it wouldn't make sense to set a name for a remote when you ask
it not to add a remote (or vice versa) these two flags are mutually
exclusive.
For lack of an idea for a more elegant solution, I've made it so that
whenever either of them matches, the other will also be dropped from the
available flags list. This works perfectly for now but will probably
need to be revisited if any other such parameters are added in future.
The --remote-name and --org parameters to git fork expect arguments
which can be considered free text because the user has to suggest a
name, so we can't provide suggestions there.
If one of those two was the previous word then we clear completion
suggestions until a free-text word has been entered, allowing the user
to add their own input there.
Instead of adding more if statements I swapped the remote=yes variable
for a list of available flags which we drop elements from on each
completion. This is based on the logic in git create above.
Fixes#2108.
* Redefined `__fish_hub_using_command` to support multiple commands (such as `hub pr list`)
* Added `hub pr list` and `hub pr checkout` along with their options
It's not only the first line of text; it's the entire first "block" (or
paragraph) of text with newlines turned into spaces. This is for
compatibility with git-commit(1).
This allows the completion script to be sourced more than once while
still behaving correctly. Previously, the script would attempt to
replace `__git_list_all_commands` blindly, which would yield
multiply-replaced calls like
`__git_list_all_commands_without_hub_without_hub`.
Previus version was written for bash v4 and was causing syntax error
when used with older versions of bash that still ship with most systems.
References 3565094d30Closes#359
This `_hub` completion script should correctly wrap modern versions of
the `_git` scripts distributed by both zsh (native) and git
(bash-based). The bash-based version could use a bit more love to
complete arguments to the actual subcommands. Right now it can only
complete the names of the subcommands themselves.
The `compdef` that was previously emitted by `hub alias -s` prevents the
new `_git` script from working, so it has been eliminated.
Fixes#231