Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to remove and list aliases #3879

Merged
merged 3 commits into from
Aug 17, 2021
Merged

Add the ability to remove and list aliases #3879

merged 3 commits into from
Aug 17, 2021

Conversation

Soumil-07
Copy link
Contributor

alias without any arguments now lists all set aliases. unalias <alias> can unset aliases.

image

@sophiajt
Copy link
Contributor

sophiajt commented Aug 2, 2021

I like the alias listing the aliases. There's also $scope.aliases. Should the first be another way to call it? Might make sense to consolidate at least.

Before we land this, I also wanted to think through how we want this to work when there are blocks that use the alias which is later unaliased. Say something like:

alias ll = ls -l
let xyz = { ll -a }
unalias ll
do $xyz

The alias was valid when the block was created, but later wouldn't be when we call xyz.

@fdncred
Copy link
Collaborator

fdncred commented Aug 6, 2021

From what I saw on discord, in the example above, xyz still functions even after the unalias. I'd like to move forward with this. What do you think @jntrnr ?

@sophiajt
Copy link
Contributor

sophiajt commented Aug 7, 2021

Great, yeah if that still works I think that's something we could keep working that way.

@Soumil-07 - can you add a few test cases so we can make sure we keep this working? It'd also be good to have a test case for using unalias and then getting an error after that because the alias is no longer available

@fdncred fdncred merged commit 9bd4084 into nushell:main Aug 17, 2021
@pejato pejato mentioned this pull request Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants