Skip to content

Fix branch create help message #1046

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 3 commits into from
Apr 30, 2025
Merged

Fix branch create help message #1046

merged 3 commits into from
Apr 30, 2025

Conversation

jgreet
Copy link
Member

@jgreet jgreet commented Apr 30, 2025

I'm not sure why but the backticks change the description of the -cluster-size flag in a confusing way.

On 0.241.0

$ pscale branch create
Error: missing arguments <source-database, branch>

Usage:
  pscale branch create <source-database> <branch> [options] [flags]

Aliases:
  create, b

Flags:
      --cluster-size pscale size cluster list   Cluster size for branches being created from a backup or seeded with data. Use pscale size cluster list to see the valid sizes. (default "PS-10")
      --from string                             Parent branch to create the new branch from. Cannot be used with --restore
...

@jgreet jgreet requested a review from a team as a code owner April 30, 2025 19:00
Copy link
Member

@iheanyi iheanyi left a comment

Choose a reason for hiding this comment

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

Can we check other uses of this flag and update their help text too?

@jgreet
Copy link
Member Author

jgreet commented Apr 30, 2025

Yeah, taking a look now. There's at least one more in pscale shell

@jgreet
Copy link
Member Author

jgreet commented Apr 30, 2025

Actually in shell --help it works. May even be intentional. Same in a few other places

"PlanetScale Database remote network address. By default the remote address is populated automatically from the PlanetScale API. (format: `hostname:port`)")

      --remote-addr hostname:port   PlanetScale Database remote network address. By default the remote address is populated automatically from the PlanetScale API. (format: hostname:port)

But api --help looks wrong, see --method or the two backticks at the end of --field

before:

  -F, --field key=value      HTTP body to send with the request, in key=value format where `value` is a JSON entity, unless `value` starts with a `@` in which case the string after `@` represents a file that will be read. Nested types are represented as `root.depth1.depth2=value``
  -H, --header stringArray   HTTP headers to add to the request
  -h, --help                 help for api
  -I, --input string         HTTP body to send with the request, as a file that will be read and then sent.
  -X, --method --field/-F    HTTP method to use for the request.  Defaults to GET for requests without a body, or POST when a body is specified with --field/-F or `--input/-I` (default "GET")
      --org string           The organization for the current user
  -Q, --query key=value      query to append to the URL path, in key=value format

after:

Flags:
      --branch string        The branch this project is using
      --database string      The database this project is using
  -F, --field stringArray    HTTP body to send with the request, in key=value format where value is a JSON entity, unless value starts with a @ in which case the string after @ represents a file that will be read. Nested types are represented as 'root.depth1.depth2=value'
  -H, --header stringArray   HTTP headers to add to the request
  -h, --help                 help for api
  -I, --input string         HTTP body to send with the request, as a file that will be read and then sent.
  -X, --method string        HTTP method to use for the request.  Defaults to GET for requests without a body, or POST when a body is specified with --field/-F or --input/-I (default "GET")
      --org string           The organization for the current user
  -Q, --query stringArray    query to append to the URL path, in key=value format

@jgreet
Copy link
Member Author

jgreet commented Apr 30, 2025

@jgreet jgreet merged commit 6e01a8a into main Apr 30, 2025
1 check passed
@jgreet jgreet deleted the jgreet/help-text branch April 30, 2025 20:00
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.

2 participants