Skip to content

Fix invalid code in history utils#1248

Open
jatinderjit wants to merge 1 commit intonushell:mainfrom
jatinderjit:fix/history-utils
Open

Fix invalid code in history utils#1248
jatinderjit wants to merge 1 commit intonushell:mainfrom
jatinderjit:fix/history-utils

Conversation

@jatinderjit
Copy link
Copy Markdown
Contributor

Fix two errors:

  1. Syntax error: list<string@"nu-complete history dir">
  2. flatten_fields expects lists of strings. Wrap from and limit in lists, since they are singular elements

(if ($exclude | is-not-empty) {[cmd not like (quote '%' $exclude '%')]})
(if not $all {[cwd = (quote $env.PWD)]})
]
orderBy: [[start desc]]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No code change here. Just moved it down for a consistent order (from > select > where > groupBy > orderBy > limit).

--before (-b): duration
--dir (-d)
--path(-p): list<string@"nu-complete history dir">
--path(-p): list<directory>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this changed from 'nu-complete history dir'? it probably shouldn't be a type but it looks like it's intended to provid completions with --path

Copy link
Copy Markdown
Contributor Author

@jatinderjit jatinderjit Apr 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a syntax error for this. I'm guessing this isn't supported.
image

I couldn't find a way to support autocomplete for lists. I could think of two alternatives:

  1. The cop out: support only a single path
  2. Use spread operator ...path: string@"nu-complete history dir".
    • It kind-of works, but has issues. num is a positional argument, and has to be populated first. Probably it would need to be changed to a flagged param.
    • We'd like to hide already selected paths from "nu-complete history dir". We'd need to use context, but I couldn't figure out how it'd handle paths with spaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants