Skip to content
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

CLI-980: Fix argument / options order in API usage examples #1404

Open
danepowell opened this issue Mar 9, 2023 · 1 comment
Open

CLI-980: Fix argument / options order in API usage examples #1404

danepowell opened this issue Mar 9, 2023 · 1 comment

Comments

@danepowell
Copy link
Contributor

For commands like api:environments:certificate-create, Symfony correctly extrapolates usage from the InputDefinition:
api:environments:certificate-create [options] [--] <environmentId> <certificate> <private_key>

Basically, the ordering here is (1) options (2) end-of-options marker (--) (3) arguments.

The problem is that we construct our own usage examples based on the API spec and they are all out of order, such as:

api:environments:certificate-create 12-d314739e-296f-11e9-b210-d663bd873d93 --legacy="" "-----BEGIN CERTIFICATE-----abc123....-----END CERTIFICATE-----" "-----BEGIN RSA PRIVATE KEY-----secret....-----END RSA PRIVATE KEY-----" --ca_certificates="-----BEGIN CERTIFICATE-----123abc....-----END CERTIFICATE-----" --csr_id="123" --label="My New Cert"

Notice that some arguments come before options, which is especially bad if your arguments contains the end-of-options marker, as in this case.

@github-actions github-actions bot changed the title Fix argument / options order in API usage examples CLI-980: Fix argument / options order in API usage examples Mar 9, 2023
@danepowell
Copy link
Contributor Author

While we could fix this... given all of the other problems with dumping multiple thousands of characters into command-line parameters... a better fix is probably to take certificate filenames as arguments.

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

No branches or pull requests

1 participant