Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

feat: Add aliases for long commands #113

Merged
merged 7 commits into from
Aug 21, 2020
Merged

Conversation

BreD1810
Copy link
Contributor

@BreD1810 BreD1810 commented Aug 18, 2020

Description

It would be nice if a user could create aliases for long commands that they use a lot. The changes made will be based upon the GitHub CLI format.

Related Issue
#108

Motivation and Context
This makes long commands easier to use.

How Has This Been Tested?
See screenshot below:
image

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@pull-assistant
Copy link

pull-assistant bot commented Aug 18, 2020

@profclems
Copy link
Owner

@all-contributors please add @BreD1810 for code, platform and documentation

@allcontributors
Copy link
Contributor

@profclems

I've put up a pull request to add @BreD1810! 🎉

@BreD1810
Copy link
Contributor Author

I'm not really sure where to go from here :/. I've had a look at the way the GitHub CLI implements executing aliases. Unfortunately, I am quite new to Golang, and very new to cobra, so I haven't managed to work it out yet.
Any suggestions are appreciated!

@profclems
Copy link
Owner

profclems commented Aug 19, 2020

I've been following your commits and I can say you started out really well.
We can save the aliases in a separate file (aliases.format) in the global config directory and map the aliased command to its corresponding key value.

@BreD1810 BreD1810 marked this pull request as ready for review August 21, 2020 10:02
@BreD1810 BreD1810 changed the title WIP feat: Add aliases for long commands feat: Add aliases for long commands Aug 21, 2020
@profclems
Copy link
Owner

profclems commented Aug 21, 2020

Great implementation @BreD1810
Works as expected 🎉

I will write unit tests for it

@profclems profclems merged commit fa25585 into profclems:trunk Aug 21, 2020
j-mcavoy pushed a commit to j-mcavoy/glab that referenced this pull request Aug 29, 2020
* feat(alias): Add help pages

* feat(alias): Add ability to add and list aliases

* feat(alias): Add ability to delete aliases

* refactor: refactor code to fix deepsource errors

* fix(alias): Use global config

* fix(alias): Use fmt to print 'That alias does not exist' instead of log

* feat(alias): Add functionality to execute aliases
@profclems profclems linked an issue Aug 31, 2020 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add aliases for long commands
2 participants