-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
154: Fix parsing of docker_switches to adhere to shell quoting rules r=maxdymond a=rlupton20 ## Why this change? At present `floki` doesn't handle quoted arguments properly in the `docker_switches` escape hatch. This adds proper shell compliant parsing of these switches. ## Relevant testing Tested by hand ``` docker_switches: - -e FOO="bar this that other" ``` ``` $ ./target/x86_64-unknown-linux-musl/debug/floki run -- echo '$FOO' bar this that other ``` Error case (missing closing quote): ``` docker_switches: - -e FOO="bar this that other ``` ``` $ ./target/x86_64-unknown-linux-musl/debug/floki run -- echo '$FOO' 23:54:45 [ERROR] A problem occurred: Malformed item in docker_switches: -e FOO="bar this that other ``` ## Contributor notes I don't think this should break anything that wasn't already broken. It would be nice if this were a little more testable, and more generally I'd like to push the validation (and flattening) of this kind of thing further toward the start of the program, so the rest can just be dumb and simple. Not for now, and perhaps only for when a need to simplify this occurs, or someone fancies the cleanup. It's hard to imagine this program getting wildly more complicated! ## Checks These aren't hard requirements, just guidelines - [x] New/modified Rust code formatted with `cargo fmt` Co-authored-by: Richard Lupton <[email protected]>
- Loading branch information
Showing
5 changed files
with
56 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters