Skip to content

Adds fix for when multiple flags are in one line. - #5493

Merged
fdncred merged 1 commit into
nushell:mainfrom
merelymyself:patch-1
May 10, 2022
Merged

fdncred merged 1 commit into
nushell:mainfrom
merelymyself:patch-1

Conversation

@merelymyself

Copy link
Copy Markdown
Contributor

Description

As per the still-active #5445, defining multiple flags in one line caused issues. This was because the function checked if the flag was in the line, not factoring in the possibility of there being multiple flags; as such, it would check if "--flag1--flag2" was equal to "--flag1", which it would clearly not be. By checking now if "--flag1--flag2" contains "--flag1", the issue is resolved.

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 --all --all-features -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect to check that you're using the standard code style
  • cargo build; cargo test --all --all-features to check that all the tests pass

@fdncred

fdncred commented May 10, 2022

Copy link
Copy Markdown
Contributor

seems reasonable. thanks.

@fdncred
fdncred merged commit f311da9 into nushell:main May 10, 2022
@merelymyself
merelymyself deleted the patch-1 branch May 10, 2022 12:17
fennewald pushed a commit to fennewald/nushell that referenced this pull request Jun 27, 2022
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