From c652f99b30cca15c5727191c5c2744ef8c05588e Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Wed, 26 Aug 2026 14:15:43 +0100 Subject: [PATCH 1/2] Shell-quote --env-var-format values Closes #1485 Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01YJDy3qA1LyNTh11zS98ukM --- newsfragments/1485.change.rst | 3 +++ src/vws_web_tools/__init__.py | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 newsfragments/1485.change.rst diff --git a/newsfragments/1485.change.rst b/newsfragments/1485.change.rst new file mode 100644 index 00000000..df62195e --- /dev/null +++ b/newsfragments/1485.change.rst @@ -0,0 +1,3 @@ +Shell-quote the values which ``--env-var-format`` prints, so that output +for a name containing a space or other shell metacharacter can be used +with ``eval`` or ``source``. diff --git a/src/vws_web_tools/__init__.py b/src/vws_web_tools/__init__.py index 6c9e88c7..89b1f252 100644 --- a/src/vws_web_tools/__init__.py +++ b/src/vws_web_tools/__init__.py @@ -4,6 +4,7 @@ import datetime import logging import re +import shlex import uuid from collections.abc import Sequence from dataclasses import dataclass @@ -1661,7 +1662,7 @@ def show_database_details( } for key, value in env_var_format_details.items(): - click.echo(message=f"{key}={value}") + click.echo(message=f"{key}={shlex.quote(s=value)}") else: click.echo(message=yaml.dump(data=details), nl=False) @@ -1701,7 +1702,7 @@ def show_vumark_database_details( } for key, value in env_var_format_details.items(): - click.echo(message=f"{key}={value}") + click.echo(message=f"{key}={shlex.quote(s=value)}") else: click.echo(message=yaml.dump(data=details), nl=False) @@ -1739,7 +1740,7 @@ def show_license_details( "VUFORIA_LICENSE_KEY": details["license_key"], } for key, value in env_var_format_details.items(): - click.echo(message=f"{key}={value}") + click.echo(message=f"{key}={shlex.quote(s=value)}") else: click.echo(message=yaml.dump(data=details), nl=False) From cf053c160f216f71a8f381ec94b062a0ed0185f9 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Wed, 26 Aug 2026 14:57:45 +0100 Subject: [PATCH 2/2] Reword the newsfragment to satisfy the spelling check Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01YJDy3qA1LyNTh11zS98ukM --- newsfragments/1485.change.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newsfragments/1485.change.rst b/newsfragments/1485.change.rst index df62195e..067c14d5 100644 --- a/newsfragments/1485.change.rst +++ b/newsfragments/1485.change.rst @@ -1,3 +1,3 @@ Shell-quote the values which ``--env-var-format`` prints, so that output -for a name containing a space or other shell metacharacter can be used -with ``eval`` or ``source``. +for a name containing a space or another character which is special to +the shell can be used with ``eval`` or ``source``.