Skip to content

Updating help message to include variations of the flags #2287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 23, 2025

Conversation

fellyph
Copy link
Collaborator

@fellyph fellyph commented Jun 18, 2025

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
Copy link
Collaborator Author

fellyph commented Jun 18, 2025

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

Copy link
Member

@akirk akirk left a comment

Choose a reason for hiding this comment

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

What about this?

@fellyph
Copy link
Collaborator Author

fellyph commented Jun 20, 2025

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

Copy link
Member

@akirk akirk left a comment

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',
string: true,
coerce: parseMountWithDelimiterArguments,
})
.option('mountDir', {
describe:
'Mount a directory to the PHP runtime. You can provide --mount-dir multiple times. Format: "/host/path" "/vfs/path"',
'Mount a directory to the PHP runtime (can be used multiple times). Format: "/host/path" "/vfs/path"',
type: 'array',
nargs: 2,
array: true,
// coerce: parseMountDirArguments,
Copy link
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
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
Copy link
Collaborator Author

fellyph commented Jun 20, 2025

@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
Collaborator

Perfection

@adamziel adamziel merged commit 86cf1fb into trunk Jun 23, 2025
24 checks passed
@adamziel adamziel deleted the fix-cli-help-messages branch June 23, 2025 10:04
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