Skip to content

Updating help message to include variations of the flags - #2287

Merged
adamziel merged 4 commits into
trunkfrom
fix-cli-help-messages
Jun 23, 2025
Merged

adamziel merged 4 commits into
trunkfrom
fix-cli-help-messages

Conversation

@fellyph

@fellyph fellyph commented Jun 18, 2025

Copy link
Copy Markdown
Collaborator

Motivation for the change, related issues

The help message from the playground CLI returns the following message for the flags --mountDir, --mountDirBeforeInstall, and --mountBeforeInstall . The flags used in the description are not using camelCase; both options are valid, but I can confuse the users. Also, the snake version of --mountDirBeforeInstall should be --mount-dir-before-install instead of --mount-before-install.

  --mountBeforeInstall             Mount a directory to the PHP runtime before installing WordPress. You can provide --mount-before-install multiple times. Format: /host/path:/
                                   vfs/path                                                                                                                              [array]
  --mountDir                       Mount a directory to the PHP runtime. You can provide --mount-dir multiple times. Format: "/host/path" "/vfs/path"                    [array]
  --mountDirBeforeInstall          Mount a directory to the PHP runtime before installing WordPress. You can provide --mount-before-install multiple times. Format: "/host/path"
                                    "/vfs/path"                                                                                                                          [array]

Implementation details

I have updated the descriptions at the cli.ts

Testing Instructions (or ideally a Blueprint)

  1. Run the CLI locally with the flag --help
  2. Check the new message:
 --mountBeforeInstall             Mount a directory to the PHP runtime before installing WordPress. You can provide --mountBeforeInstall or --mount-before-install multiple times. Format: /host/path:/vfs/path
                                                                                                                                                                                                         [array]
  --mountDir                       Mount a directory to the PHP runtime. You can provide --mountDir or --mount-dir multiple times. Format: "/host/path" "/vfs/path"                                      [array]
  --mountDirBeforeInstall          Mount a directory to the PHP runtime before installing WordPress. You can provide --mountDirBeforeInstall or --mount-dir-before-install multiple times. Format: "/host/path"
                                   "/vfs/path"                                                                                                                                                           [array]

@fellyph
fellyph requested a review from akirk June 18, 2025 15:27
@fellyph

fellyph commented Jun 18, 2025

Copy link
Copy Markdown
Collaborator Author

@akirk Should we include both variations of the flag, or stick with the camelCase ?

@akirk akirk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this?

Comment thread packages/playground/cli/src/cli.ts Outdated
Comment thread packages/playground/cli/src/cli.ts Outdated
Comment thread packages/playground/cli/src/cli.ts Outdated
@fellyph

fellyph commented Jun 20, 2025

Copy link
Copy Markdown
Collaborator Author

@akirk, I have included the new text based on your suggestion

@akirk akirk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!

type: 'array',
nargs: 2,
array: true,
// coerce: parseMountDirArguments,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bgrgicak should this be commented out?

@adamziel

Copy link
Copy Markdown
Collaborator

Can we find a way to print the --kebab-case version? Blueprints V2 will use that convention. If not, no big deal, we can still merge it as it's an improvement.

@fellyph

fellyph commented Jun 20, 2025

Copy link
Copy Markdown
Collaborator Author

@adamziel what about this one:

Options:
  --help                               Show help                                                                                                  [boolean]
  --version                            Show version number                                                                                        [boolean]
  --outfile                            When building, write to this output file.                                        [string] [default: "wordpress.zip"]
  --port                               Port to listen on when serving.                                                             [number] [default: 9400]
  --php                                PHP version to use.      [string] [choices: "8.4", "8.3", "8.2", "8.1", "8.0", "7.4", "7.3", "7.2"] [default: "8.0"]
  --wp                                 WordPress version to use.                                                               [string] [default: "latest"]
  --mount                              Mount a directory to the PHP runtime. You can provide --mount multiple times. Format: /host/path:/vfs/path   [array]
  --mount-before-install               Mount a directory to the PHP runtime before WordPress installation (can be used multiple times). Format: /host/path:
                                       /vfs/path                                                                                                    [array]
  --mount-dir                          Mount a directory to the PHP runtime (can be used multiple times). Format: "/host/path" "/vfs/path"          [array]
  --mount-dir-before-install           Mount a directory before WordPress installation (can be used multiple times). Format: "/host/path" "/vfs/path"
                                                                                                                                                    [array]
  --login                              Should log the user in                                                                    [boolean] [default: false]
  --blueprint                          Blueprint to execute.                                                                                       [string]
  --blueprint-may-read-adjacent-files  Consent flag: Allow "bundled" resources in a local blueprint to read files in the same directory as the blueprint fi
                                       le.                                                                                       [boolean] [default: false]
  --skip-wordpress-setup               Do not download, unzip, and install WordPress. Useful for mounting a pre-configured WordPress directory at /wordpres
                                       s.                                                                                        [boolean] [default: false]
  --skip-sqlite-setup                  Skip the SQLite integration plugin setup to allow the WordPress site to use MySQL.        [boolean] [default: false]
  --quiet                              Do not output logs and progress messages.                                                 [boolean] [default: false]
  --debug                              Print PHP error log content if an error occurs during Playground boot.                    [boolean] [default: false]
  --auto-mount                         Automatically mount the current working directory. You can mount a WordPress directory, a plugin directory, a theme
                                       directory, a wp-content directory, or any directory containing PHP and HTML files.        [boolean] [default: false]
  --follow-symlinks                    Allow Playground to follow symlinks by automatically mounting symlinked directories and files encountered in mounted
                                        directories.
                                       Warning: Following symlinks will expose files outside mounted directories to Playground and could be
                                       a security risk.                                                                          [boolean] [default: false

@adamziel

Copy link
Copy Markdown
Collaborator

Perfection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants