]> _ Git - alire.git/commit
feat: Add shell-style quoting and escaping to edit and run commands
authormivirl <octoberstargazer7405@mivirl.dev>
Mon, 4 Aug 2025 22:03:17 +0000 (22:03 +0000)
committermivirl <octoberstargazer7405@mivirl.dev>
Mon, 4 Aug 2025 22:03:17 +0000 (22:03 +0000)
commit8a496dc2697174b4f5395990131cd478aa68c949
tree6ad344393a86c5f8948294da015b1e2b5dda5d8d
parenta06aac7cf88f77d2fc4bb9dd7ae9de2155c3236b
feat: Add shell-style quoting and escaping to edit and run commands

Allows specifying a custom editor command with quoted spaces

`${CRATE_ROOT}` and `${GPR_FILE}` are still replaced directly, not
using parameter expansion.

The argument to `alr run -a` has been changed to use the same quoting
rules as `alr edit` instead of using the OS-specific rules provided by
`GNAT.OS_Lib.Argument_String_To_List`.

Quoting and token recognition uses the behavior for the shell command
language from the POSIX.1-2024 standard with a few changes:
- [2.2.2 Single-Quotes](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_02_02)
  - No changes
- [2.2.3 Double-Quotes](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_02_02)
  - The dollar-sign is not used for parameter expansion, command
    substitution, or arithmetic expansion
  - The backquote is not used for command substitution
  - The backslash is an escape character within double quotes only when
    immediately followed by `\` or `"`
- [2.3 Token Recognition](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_03)
  - Here-documents are not supported
  - Parameter expansion, command substitution, and arithmetic expansion
    are not supported
  - Comments are not supported
  - Alias substitution is not supported
BREAKING.md
doc/user-changes.md
src/alire/alire-os_lib-subprocess.adb
src/alire/alire-os_lib-subprocess.ads
src/alire/alire-spawn.adb
src/alire/alire-spawn.ads
src/alr/alr-commands-run.adb
src/alr/alr-os_lib.adb
testsuite/tests_ada/src/alr_tests-split_arguments.adb [new file with mode: 0644]