-
Notifications
You must be signed in to change notification settings - Fork 222
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
Missing flag argument in git aliases #493
Comments
this looks like an issue with the completion of |
Anyone suceeded to make it work or find a workaround? |
@TechWatching export alias gcam = git commit --all --message into the REPL of the latest revision of Nushell appears to work 🤔 |
@amtoine Yet I still have the error using 0.85.0 👉 In my config.nu file I am doing |
@TechWatching the new release of Nushell goes out in a few hours, can you please try again after updating and keep me updated? 😇 |
@TechWatching @amtoine |
updates and patches come fast, i'm not really surprised 😉 |
@fnuttens if, after the release, any of you guys can reproduce the error again, please feel free to ping here to reopen 😊 |
@amtoine still an issue with 0.86 on my windows laptop. |
maybe that's a windows issue? 🤔 |
It definitely works in Linux and does not work in Windows. I just confirmed with the latest main in Windows 11 and WSL Ubuntu. |
I'm also using Windows 11 and I don't have the bug, so I reckon it's more subtle than “just” a Windows issue. |
If I start nushell like use d:\nu_scripts\aliases\git\git-aliases.nu without any problems. but with my normal startup, it fails. no clue why. |
Ah, I think I figured it out. It's because of this in git-completions.nu # Commit changes
export extern "git commit" [
--all(-a) # automatically stage all modified and deleted files
--amend # amend the previous commit rather than adding a new one
--message(-m): string # specify the commit message rather than opening an editor
--no-edit # don't edit the commit message (useful with --amend)
] So, when this tries to happen export alias gcam = git commit --all --message It sees that If I remove the Error: nu::parser::missing_flag_param
× Missing flag argument.
╭─[D:\nu_scripts\aliases\git\git-aliases.nu:51:1]
51 │ export alias gcasm = git commit --all --signoff --message
52 │ export alias gcb = git checkout -b
· ─┬
· ╰── flag missing string argument
53 │ export alias gcd = git checkout develop
╰──── |
This PR fixes the conflicts between git-completions.nu and git-aliases.nu. Prior to this PR you would see problems like this ```nushell ❯ use custom-completions\git\git-completions.nu * ❯ use aliases\git\git-aliases.nu Error: nu::parser::missing_flag_param × Missing flag argument. ╭─[D:\nu_scripts\aliases\git\git-aliases.nu:64:1] 64 │ export alias gco = git checkout 65 │ export alias gcor = git checkout --recurse-submodules · ──────────┬───────── · ╰── flag missing string argument 66 │ export alias gcount = git shortlog --summary --numbered ╰──── ``` This is because, in this example, in git-completions.nu, there is a custom command named `git checkout` that takes a `--recurse-submodules: string` parameter, which means it's expecting a string. Removing the `: string` part fixes the issue and allows the files to be sourced/used as expected. This seems more like a hack than a fix. I'm not sure if this behavior is intended or not, but this PR fixes it anyway. close #493
Trying to load nu_alias_git.nu fails at
nu_scripts/aliases/git/nu_alias_git.nu
Line 48 in 2c37b5f
with
The text was updated successfully, but these errors were encountered: