-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
enhancementa request to improve CLIa request to improve CLIhelp wantedContributions welcomeContributions welcome
Description
Describe the feature or problem you’d like to solve
We can add alias by gh alias set command. There are no problems when adding a new alias, but it seems to be a little problem when overwriting it.
Existing implementation can easily overwrite aliases that are already registered as follows.
$ gh alias set mypr 'pr list -s all -a JunNishimura'
- Adding alias for mypr: pr list -s all -a JunNishimura
✓ Added alias.
$ gh alias set mypr 'pr list'
- Adding alias for mypr: pr list
✓ Changed alias mypr from pr list -s all -a JunNishimura to pr listThis is not a problem if the user overwrites the alias intentionally, but if the alias is accidentaly overwritten, the user is forced to re-register the alias. This is not kind to the user, I think.
(To output how the alias was changed is good behaviour.)
Proposed solution
When a user tries to overwrite the alias, a confirmation message is displayed as follows
$ gh alias set mypr 'pr list -s all -a JunNishimura'
- Adding alias for mypr: pr list -s all -a JunNishimura
✓ Added alias.
$ gh alias set mypr 'pr list'
> "mypr" is already used. Do you want to overwrite? (y/N)If the user says 'yes', the rest of the message continues as usual.
> "mypr" is already used. Do you want to overwrite? (y/N)
- Adding alias for mypr: pr list
✓ Changed alias mypr from pr list -s all -a JunNishimura to pr listReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementa request to improve CLIa request to improve CLIhelp wantedContributions welcomeContributions welcome