Files
yq/pkg/yqlib
Flint WintersandGitHub f98028c925 Unwrap scalars in shell output mode. (#2548)
* feat: Add UnwrapScalar to ShellVariablesPreferences

- Add UnwrapScalar boolean field to ShellVariablesPreferences struct.
- Initialize UnwrapScalar to false in NewDefaultShellVariablesPreferences.
- This preference will control whether shell output should be quoted or raw.

* feat: Propagate unwrapScalar to ShellVariablesPreferences

- In configureEncoder function, set UnwrapScalar in ConfiguredShellVariablesPreferences.
- This ensures the -r flag's state is passed to the shell encoder for raw output control.

* feat: Implement conditional quoting in shellVariablesEncoder

- Modify doEncode method to check pe.prefs.UnwrapScalar.
- If UnwrapScalar is true, output raw node.Value.
- Otherwise, use quoteValue for shell-safe quoting.
- This enables quote-free output for Kubernetes workflows when -r is used.

* test: Add tests for UnwrapScalar in shell encoder

- Introduce assertEncodesToUnwrapped helper function.
- Add TestShellVariablesEncoderUnwrapScalar to verify quote-free output with -r.
- Add TestShellVariablesEncoderDefaultQuoting to confirm default quoting behavior without -r.
- Ensure comprehensive testing of conditional quoting logic for shell output.

* remove redundant test
2026-01-01 15:21:55 +11:00
..
2023-10-18 12:11:53 +11:00
2025-07-11 22:00:20 +10:00
2023-10-18 12:36:52 +11:00
2025-07-11 22:00:20 +10:00
2025-12-08 21:09:21 +11:00
2025-12-20 19:11:48 +11:00
2023-10-18 12:11:53 +11:00
2023-10-18 12:11:53 +11:00
2025-05-04 10:33:09 +10:00
2025-12-16 20:47:15 +11:00
2025-12-20 19:11:48 +11:00
2025-12-20 19:11:48 +11:00
2025-05-17 18:55:53 +10:00
2024-02-24 15:48:59 +11:00
2025-05-03 16:34:21 +10:00
2024-02-24 15:03:30 +11:00
2025-10-12 14:50:41 +11:00
2025-11-09 16:12:17 +11:00
2025-05-03 16:34:21 +10:00
2022-01-14 15:22:55 +11:00
2025-06-07 15:23:38 +10:00
2025-12-16 14:22:50 +11:00
2025-12-08 20:30:47 +11:00
2025-05-17 18:55:53 +10:00
2025-05-17 18:55:53 +10:00
2024-02-24 15:59:12 +11:00
2025-12-20 15:36:49 +11:00
2025-11-25 10:17:43 +11:00
2025-11-25 10:17:43 +11:00
2024-02-24 15:36:16 +11:00
2023-10-18 12:11:53 +11:00
2025-12-08 20:30:47 +11:00
2023-10-03 16:22:23 +11:00
2025-12-26 11:08:24 +11:00
2025-11-09 16:12:17 +11:00
2025-06-12 15:41:27 +10:00
2025-06-12 15:41:27 +10:00
2025-07-22 11:25:02 +10:00
2023-10-18 12:11:53 +11:00
2024-01-11 13:17:34 +11:00
2023-10-18 12:11:53 +11:00
2022-11-01 09:29:05 +11:00
2024-01-11 13:17:34 +11:00
2023-10-18 12:11:53 +11:00
2024-01-11 13:17:34 +11:00
2025-05-03 16:34:21 +10:00
2023-10-18 12:11:53 +11:00
2024-01-11 13:17:34 +11:00
2024-03-05 10:40:55 +11:00
2023-10-18 12:11:53 +11:00
2023-10-18 12:11:53 +11:00
2024-11-16 11:48:53 +11:00
2023-10-18 12:11:53 +11:00
2024-01-11 13:17:34 +11:00
2025-11-09 16:12:17 +11:00
2025-11-09 16:12:17 +11:00
2023-10-18 12:11:53 +11:00
2023-10-02 14:43:12 +11:00
2024-01-11 13:17:34 +11:00
2023-03-16 13:39:36 +11:00
2024-01-11 13:17:34 +11:00
2023-10-18 12:11:53 +11:00
2024-01-11 13:17:34 +11:00
2025-05-03 16:34:21 +10:00
2025-05-03 16:34:21 +10:00
2025-05-03 16:34:21 +10:00
2025-05-03 16:34:21 +10:00
2025-05-03 16:34:21 +10:00
2023-10-18 12:11:53 +11:00
2024-03-30 13:29:35 +11:00
2024-01-11 13:17:34 +11:00
2024-01-11 13:17:34 +11:00
2023-10-18 12:11:53 +11:00
2023-10-18 12:11:53 +11:00
2025-05-03 16:34:21 +10:00
2025-05-03 16:34:21 +10:00
2025-06-07 15:23:38 +10:00
2025-05-03 16:34:21 +10:00
2023-10-18 12:11:53 +11:00
2024-01-11 13:17:34 +11:00
2024-01-11 13:17:34 +11:00
2023-10-18 12:11:53 +11:00
2023-10-18 12:11:53 +11:00
2025-06-07 15:23:38 +10:00
2024-06-15 17:06:17 +10:00
2024-01-11 13:17:34 +11:00
2023-10-18 12:11:53 +11:00
2024-01-11 13:17:34 +11:00
2025-09-09 20:16:49 +10:00
2025-12-20 19:11:48 +11:00
2025-12-20 19:11:48 +11:00
2025-05-03 16:34:21 +10:00
2024-02-24 15:14:21 +11:00
2024-02-21 14:50:55 +11:00
2023-10-18 12:11:53 +11:00
2025-12-20 19:15:36 +11:00
2025-12-14 19:41:45 +11:00
2023-09-19 10:43:11 +10:00
2024-02-24 15:03:30 +11:00
2025-12-06 19:08:37 +11:00
2025-07-14 16:26:26 +10:00