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
completions nushell generates nushell completions with switch arguments of type string instead of int.
This conflicts with what I seem to see in the pueue sources (cli.rs) and the nu-scripts task.nu pueue wrapper that the official nu documentation references.
Steps to reproduce
pueue completions nushell | save -f pueue-completions.nu
use pueue-completions.nu *
http get https://raw.githubusercontent.com/nushell/nu_scripts/refs/heads/main/modules/background_task/task.nu | save -f task.nu
use task.nu
nu ❯ use task.nu ~\temp
Error: nu::parser::type_mismatch
× Type mismatch.
╭─[C:\Users\redacted\temp\task.nu:76:16]
75 │ ] {
76 │ pueue switch $task_id_1 $task_id_2
· ─────┬────
· ╰── expected string, found int
77 │ }
╰────
### Debug logs (if relevant)
_No response_
### Operating system
Windows 11
### Pueue version
3.4.1
### Additional context
In the generated nu code, for `switch` the parameter types are string
```nu
export extern "pueue switch" [
task_id_1: string # The first task id
task_id_2: string # The second task id
--help(-h) # Print help
]
despite cli.rs defining usize types
Switch{/// The first task id.task_id_1: usize,/// The second task id.task_id_2: usize,}
That alone is not an issue for command line completions, albeit unspecific.
I tried to find the cause, diving into pueue and clip, cli.rs and the generate call. I'm not too familiar with Rust. When I found it seems to use macros and type information transformation I had to give up.
The text was updated successfully, but these errors were encountered:
Describe the bug
completions nushell
generates nushell completions with switch arguments of type string instead of int.This conflicts with what I seem to see in the pueue sources (
cli.rs
) and the nu-scriptstask.nu
pueue wrapper that the official nu documentation references.Steps to reproduce
despite
cli.rs
definingusize
typesThat alone is not an issue for command line completions, albeit unspecific.
Nushell has a nu-scripts repository with a
task
module/custom command, and refers to pueue and task on the background tasks documentation. This command defines aliases and mappings to pueue commands. The switch command defines the parameters to be int types. When callingpueue switch
this type conflicts with the string type generated by pueue completions and results intask.nu
not being usable.I tried to find the cause, diving into pueue and clip, cli.rs and the generate call. I'm not too familiar with Rust. When I found it seems to use macros and type information transformation I had to give up.
The text was updated successfully, but these errors were encountered: