Repository navigation
fixes which showing aliases as built-in nushell commands - #9580
Conversation
amtoine
left a comment
There was a problem hiding this comment.
looks like a simple change which solves the issue, thanks 👌
just a minor change as you probably guessed 😉
which showing aliases as built-in nushell commandswhich showing aliases as built-in nushell commands
|
@AyushSingh13 |
|
We already have some Maybe the following works now and doesn't need to be ignored after @kubouch 's new alias work: nushell/crates/nu-command/tests/commands/which.rs Lines 13 to 22 in 9ef1203 |
|
Yeah, some of these tests we might be able to un-ignore. Otherwise the PR looks good to me! |
|
yup, if we have ignored test that we can un-ignore then let's go for it 😋 |
Of course! I've added a test |
|
@AyushSingh13 it's hard to tell because the CI stops on Clippy 😮 if it passes i'd say let's leave this other issue for another PR, otherwise, it might be related so we should fix the tests in this PR 😋 |
Mhh if the test that is currently ignored still fails for unrelated reasons, let's keep it out of this PR for now. (Maybe there is still a problem with "recursive" aliases) |
@amtoine - Apologies for that, I should've run those clippy, fmt and tests locally! The tests and clippy both passed before but fmt gave us this: $ cargo fmt --all -- --check
Diff in /Users/ayush/projects/nushell/crates/nu-command/tests/commands/which.rs at line 24:
#[test]
fn which_custom_alias() {
let actual = nu!(
- cwd: ".",
+ cwd: ".",
r#"alias foo = print "foo!"; which foo | get path.0 | str trim"#
); I'm unsure what that diff is and not sure how I can go about comparing what it is - both lines look the same to me! Either way, I've fixed this now, edited the test to use |
there was a trailing whitespace before the patch 😋 the easiest is to run |
Ah, that makes sense - thank you! Will go create the issue for including the alias definition and hopefully get deeper into things! thank you for all your help |
anytime 😉
👌 |
fixes #8577
Description
Currently, using
whichon an alias describes it as a nushell built-in command:This PR fixes the behaviour above to the following:
User-Facing Changes
Passing in an alias to
whichwill no longer returnNushell built-in command,trueforpathandbuilt-inrespectively.Tests + Formatting
After Submitting