Skip to content

Allowing for flags with '=' in them to register as flags.#5579

Merged
fdncred merged 2 commits intonushell:mainfrom
merelymyself:main
May 18, 2022
Merged

Allowing for flags with '=' in them to register as flags.#5579
fdncred merged 2 commits intonushell:mainfrom
merelymyself:main

Conversation

@merelymyself
Copy link
Copy Markdown
Contributor

Description

While this fixes #5532, I don't think this is sustainable in the long run. Per the discussion in #5492, hopefully a more sustainable long-term solution can be found in the near future.

/home/gabriel/CodingProjects/nushell〉cat b.nu                                05/18/2022 11:54:57 PM
# b.nu
def main [kernel: string, --version: string] {
    echo $kernel;
    echo $version
}
/home/gabriel/CodingProjects/nushell〉target/debug/nu b.nu linux --version=v5.2
linux
v5.2

Tests

Make sure you've run and fixed any issues with these commands:

  • cargo fmt --all -- --check to check standard code formatting (cargo fmt --all applies these changes)
  • cargo clippy --workspace --features=extra -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect to check that you're using the standard code style
  • cargo test --workspace --features=extra to check that all the tests pass

@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented May 18, 2022

nice. thanks!

@fdncred fdncred merged commit 6c56829 into nushell:main May 18, 2022
fennewald pushed a commit to fennewald/nushell that referenced this pull request Jun 27, 2022
* hacky fix for registering flags with '='

* fmt
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.

Can't pass flags with = into script's main command

2 participants