Skip to content

Shell-quote --env-var-format values - #1528

Merged
adamtheturtle merged 2 commits into
mainfrom
adamtheturtle/vws-web-tools-issue-1485
Aug 27, 2026
Merged

Shell-quote --env-var-format values#1528
adamtheturtle merged 2 commits into
mainfrom
adamtheturtle/vws-web-tools-issue-1485

Conversation

@adamtheturtle

Copy link
Copy Markdown
Member

Closes #1485.

--env-var-format exists so its output can be fed to eval or source, but it wrote KEY=value raw. A database or license name containing a space produced a line the shell splits into an assignment plus a command; other metacharacters are worse.

All three --env-var-format blocks — show-database-details, show-vumark-database-details and show-license-details — now pass the value through shlex.quote.

Access keys and license keys are alphanumeric, so shlex.quote leaves them exactly as they were and existing output is unchanged. Only the name fields, which come from whatever the caller passed to --database-name / --license-name, can gain quotes.

The existing --env-var-format tests parse with line.split("=", 1) and still pass, since the values they see need no quoting. I have not added a test with a name that does need quoting: that would mean creating a real database with a space in its name against the shared CI account for one assertion.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YJDy3qA1LyNTh11zS98ukM

Closes #1485

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJDy3qA1LyNTh11zS98ukM
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJDy3qA1LyNTh11zS98ukM
@adamtheturtle
adamtheturtle merged commit 9cf0ab2 into main Aug 27, 2026
29 checks passed
@adamtheturtle
adamtheturtle deleted the adamtheturtle/vws-web-tools-issue-1485 branch August 27, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--env-var-format does not shell-quote values containing equals or spaces

1 participant