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
{{ message }}
Repository navigation
Incorrect name in missing argument error for main command #10191
A:error-unhelpfulThe error message you observe is not helpful to identify the problemusage:script-fileIssues related to executing a script file (as opposed to a module or sourcing)
Invoking a script with no arguments, when it contains a main command that requires a positional parameter, produces an error message referencing main rather than the name of the script.
How to reproduce
Put the following in a file named ./script.nu with the executable bit set.
#!/usr/bin/env nu
def main [foo: string] {
print$foo
}
#9948 did fix ./script.nu --help which does not mention main anymore, but yeah this kind of errors should also not mention main but rather the name of the script 👍
A:error-unhelpfulThe error message you observe is not helpful to identify the problemusage:script-fileIssues related to executing a script file (as opposed to a module or sourcing)
Activity
amtoine commentedon Sep 2, 2023
good catch 👌
#9948 did fix
./script.nu --helpwhich does not mentionmainanymore, but yeah this kind of errors should also not mentionmainbut rather the name of the script 👍@jt, that might be an easy fix?
fix(cli): show the script name instead of `main` in errors about a sc…