Files
seaweedFS/weed/shell
Chris Lu 49c66bbb2e shell: allow spaces in arguments via quoting (#8157) (#8165)
* shell: allow spaces in arguments via quoting (#8157)

- updated argument splitting regex to handle quoted segments
- added robust quote stripping to remove matching quotes from flags
- added unit tests for regex splitting and flag parsing

* shell: use robust state machine parser for command line arguments

- replaced regex-based splitter with splitCommandLine state machine
- added escape character support in splitCommandLine and stripQuotes
- updated unit tests to include escaped quotes and single-quote literals
- addressed feedback regarding escaped quotes handling (#8157)

* shell: detect unbalanced quotes in stripQuotes

- modified stripQuotes to return the original string if quotes are unbalanced
- added test cases for unbalanced quotes in shell_liner_test.go

* shell: refactor shared parsing logic into parseShellInput helper

- unified splitting and unquoting logic into a single state machine
- splitCommandLine now returns unquoted tokens directly
- simplified processEachCmd by removing redundant unquoting loop
- improved maintainability by eliminating code duplication

* shell: detect trailing backslash in stripQuotes

- updated parseShellInput to include escaped state in unbalanced flag
- stripQuotes now returns original string if it ends with an unescaped backslash
- added test case for trailing backslash in shell_liner_test.go
2026-01-29 19:06:17 -08:00
..
2025-12-28 11:39:06 -08:00
2024-09-29 10:38:22 -07:00
2024-09-29 10:38:22 -07:00
2024-09-29 10:38:22 -07:00
2024-09-29 10:38:22 -07:00
2024-09-29 10:38:22 -07:00