Skip to content

gh alias set #938

Description

@vilmibm

This issue covers implementing "internal" style (no shell expansion) aliases gh alias set <alias name> <expansion>.

Valid invocations

  • gh alias set co pr checkout
  • gh alias set co "pr checkout"

Expected outputs

Bad command:

$ gh alias set co pa checkout
X No such command: pa. Not saving alias.

Already in use:

$ gh alias set co pr checkout
X "co" alias is already in use as "pr checkout"

Success:

$ gh alias set co pr checkout
:check: "gh co" now expands to "gh pr checkout"

Activity

  1. self-assigned this
    on May 15, 2020
  2. mislav commented on May 18, 2020

    @mislav
    Contributor

    Will we allow alias names that match an existing command, e.g. would we allow creating a repo alias? I would suggest that we disallow that since it opens a whole can of worms:

    $ gh alias set repo ...
    X "repo" is a built-in command and cannot be used as alias

    Already in use:

    $ gh alias set co pr checkout
    X "co" alias is already in use as "pr checkout"
    

    Will we have an option to overwrite the alias? I think we could support somethink like the -f, --force flag to opt-into overwriting an old alias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions