You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@amtoine Can we even have an alias for a command in a module?
Let's have a mymodule.nu file with:
export def mycommand [] { "Hello" }
export alias myalias1 = mymodule mycommand
export alias myalias2 = mycommand
None of these alias can be used universally:
❯ nu -c 'use mymodule.nu *; mycommand; myalias2; myalias1'
Hello
Hello
Error: nu::shell::external_command (link)
× External command failed
╭─[source:1:1]
1 │ use mymodule.nu *; mycommand; myalias2; myalias1
· ────┬───
· ╰── did you mean 'module'?
╰────
help: program not found
And
❯ nu -c 'use mymodule.nu; mymodule mycommand; mymodule myalias1; mymodule myalias2'
Hello
Hello
Error: nu::shell::external_command (link)
× External command failed
╭─[source:1:1]
1 │ use mymodule.nu; mymodule mycommand; mymodule myalias1; mymodule myalias2
· ────────┬────────
· ╰── command 'mycommand' was not found but it was imported from module 'mymodule'; try using `mymodule mycommand`
╰────
help: program not found
Activity
amtoine commentedon Mar 14, 2023
i agree with this 👍
nushellmight be a bit verbose sometimes, but gains with its completion and in readability 💪and as it's a simple change, i think there's no harm in seing how it works with people 😉
presidento commentedon Mar 14, 2023
Thank you, I'll do it soon, when it is appropriate.
amtoine commentedon Mar 15, 2023
when you have time 😉
presidento commentedon Mar 18, 2023
@amtoine Can we even have an alias for a command in a module?
Let's have a
mymodule.nufile with:None of these alias can be used universally:
And
amtoine commentedon Mar 18, 2023
it appears not 🤔
i'm having the same kind of errors!
amtoine commentedon Mar 18, 2023
i'd drop the
aliasidea for now and let the user do it.in the meantime, that might give a nice improvement in a feature request 😉
stdlib: Implement common assert commands (#8515)