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

Lists recognize string as unknown command #13901

Open
dougg0k opened this issue Sep 22, 2024 · 2 comments
Open

Lists recognize string as unknown command #13901

dougg0k opened this issue Sep 22, 2024 · 2 comments
Labels
🐛 bug Something isn't working parser Issues related to parsing

Comments

@dougg0k
Copy link

dougg0k commented Sep 22, 2024

Describe the bug

For whatever reason, when building a list/array, and the string put there has a key=value, it gives an error.

Only seem to have if there is no space. Same with =number/letter.

nu ✗ let list = ["VAR=1"]
Error: nu::parser::unknown_command

  × Unknown command.
   ╭─[entry #25:1:12]
 1 │ let list = ["VAR=1"]
   ·            ────┬────
   ·                ╰── unknown command
   ╰────

How to reproduce

You can straight type let list = ["VAR=1"] or put into a file.

Expected behavior

To just be a string, even more so when in between quotes.

Configuration

key value
version 0.98.0
major 0
minor 98
patch 0
branch
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.81.0 (eeb90cda1 2024-09-04)
rust_channel stable-x86_64-unknown-linux-gnu
cargo_version cargo 1.81.0 (2dbb1af80 2024-08-20)
build_time 2024-09-21 16:21:54 -03:00
build_rust_channel release
allocator mimalloc
features default, sqlite, trash
installed_plugins bash_env 0.14.2
@dougg0k dougg0k added the needs-triage An issue that hasn't had any proper look label Sep 22, 2024
@fdncred
Copy link
Collaborator

fdncred commented Sep 22, 2024

Seems like a bug buy here's a work-around. Use spaces around items in your list.

 let list = [ "VAR=1" ]
 $list
╭───┬───────╮
 0  VAR=1 
╰───┴───────╯

@fdncred fdncred added 🐛 bug Something isn't working parser Issues related to parsing labels Sep 22, 2024
@dougg0k
Copy link
Author

dougg0k commented Sep 22, 2024

Yeah, that seems to be the case with a comment too. But only if there is a space in the comment.

let list = [
  # "VAR1=1",
  "VAR2=2",
  "VAR3=3",
]

@sholderbach sholderbach removed the needs-triage An issue that hasn't had any proper look label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working parser Issues related to parsing
Projects
None yet
Development

No branches or pull requests

3 participants