Skip to content
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

Allow more types for input list #11195

Merged
merged 1 commit into from
Dec 1, 2023
Merged

Conversation

KAAtheWiseGit
Copy link
Contributor

input list now allows all types by using into_string.

Custom formatting logic for records was removed.

Allow ranges as an input types.

Also made the prompt check depend on option, so input list "" will have an empty prompt, while input list does not.

Resolve #11181

`input list` now allows all types by using `into_string`.

Custom formatting logic for records was removed.

Allow ranges as an input types.

Also made the prompt check depend on option, so `input list ""` will
have an empty prompt, while `input list` does not.

Resolve nushell#11181
@fdncred
Copy link
Collaborator

fdncred commented Nov 30, 2023

Nice! Ya, it's probably best to remove that custom formatting. This seems to work for me.

@KAAtheWiseGit
Copy link
Contributor Author

The only issue I see is that this allows to pass closures and blocks to input list, but I feel that it isn't that much of a problem.

@fdncred
Copy link
Collaborator

fdncred commented Nov 30, 2023

I mean, it's a little weird to have a closure there.

❯ [1 a true {|| echo 1}] | input list
  a
  true
  <Closure 3162>

If you could unravel the closure into what it is, that would be ok, but just having a useless <Closure 3162> seems not too good. I'm not quite sure what a block would look like.

@KAAtheWiseGit
Copy link
Contributor Author

@fdncred I thought about it, but I don't think that's possible. In theory internal_span can be used in into_string, but I don't see a way to make fit it into one line.

@fdncred
Copy link
Collaborator

fdncred commented Nov 30, 2023

I won't hold this PR up for a change, but it's still weird to have closures like this.

@fdncred fdncred merged commit 6ea5bdc into nushell:main Dec 1, 2023
19 checks passed
@fdncred
Copy link
Collaborator

fdncred commented Dec 1, 2023

Thanks

@KAAtheWiseGit KAAtheWiseGit deleted the input-list branch December 1, 2023 18:30
hardfau1t pushed a commit to hardfau1t/nushell that referenced this pull request Dec 14, 2023
`input list` now allows all types by using `into_string`.

Custom formatting logic for records was removed.

Allow ranges as an input types.

Also made the prompt check depend on option, so `input list ""` will
have an empty prompt, while `input list` does not.

Resolve nushell#11181
dmatos2012 pushed a commit to dmatos2012/nushell that referenced this pull request Feb 20, 2024
`input list` now allows all types by using `into_string`.

Custom formatting logic for records was removed.

Allow ranges as an input types.

Also made the prompt check depend on option, so `input list ""` will
have an empty prompt, while `input list` does not.

Resolve nushell#11181
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.

input list errors on lists with booleans
2 participants