Skip to content

fix: quote CLI string examples with whitespace - #1863

Merged
ChiragAgg5k merged 2 commits into
appwrite:mainfrom
ChiragAgg5k:fix/cli-quote-string-examples
Aug 31, 2026
Merged

fix: quote CLI string examples with whitespace#1863
ChiragAgg5k merged 2 commits into
appwrite:mainfrom
ChiragAgg5k:fix/cli-quote-string-examples

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Aug 31, 2026

Copy link
Copy Markdown
Member

Summary

  • quote generated CLI string examples when they contain shell-unsafe characters
  • escape embedded single quotes using POSIX shell-safe quoting
  • fix generated commands such as --default Hello World and values such as don't

Fixes the Greptile finding on appwrite/sdk-for-cli#362.

Validation

  • php example.php cli
  • composer refactor:check
  • composer lint
  • composer lint-twig
  • test -z "$(gofmt -l examples/cli)"
  • git diff --check

@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR updates generated CLI string examples to use shell-safe quoting for whitespace and other unsafe characters.

  • Detects characters outside a conservative shell-safe set.
  • Wraps affected values in single quotes.
  • Escapes embedded apostrophes using the standard 3216'"'"' sequence.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/SDK/Language/Concern/CliCommandSurface.php Expands CLI string-example quoting to cover apostrophes and shell metacharacters; the previously reported whitespace-free apostrophe failure is resolved.

Reviews (3): Last reviewed commit: "fix: escape shell metacharacters in CLI ..." | Re-trigger Greptile

Comment thread src/SDK/Language/Concern/CliCommandSurface.php Outdated
@ChiragAgg5k

Copy link
Copy Markdown
Member Author

@greptile review

@ChiragAgg5k
ChiragAgg5k merged commit 3a6e28f into appwrite:main Aug 31, 2026
58 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/cli-quote-string-examples branch August 31, 2026 20:15
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.

1 participant