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

Localize flags to each subcommand #274

Merged
merged 1 commit into from
Dec 12, 2021

Conversation

nsmith5
Copy link
Contributor

@nsmith5 nsmith5 commented Dec 12, 2021

Summary

Makes CLI usage a little more clear by moving global flags to their relevant subcommands.

Before

$ fulcio createca -h
Create an x509 root CA within a pkcs11 device using values
such as organization, country etc. This can then be used as the root
certificate authority for an instance of sigstore fulcio

Usage:
  fulcio createca [flags]

Flags:
      --country string          Country name for root CA
  -h, --help                    help for createca
      --hsm string              The HSM provider to use. Valid values: softhsm (default), aws (default "softhsm")
      --locality string         Locality name for root CA
      --org string              Organization name for root CA (default "Fulcio Root CA")
      --out string              output root CA to file
      --postal-code string      Postal code for root CA
      --province string         Province name for root CA
      --street-address string   Street address for root CA

Global Flags:
      --aws-hsm-root-ca-path string     Path to root CA on disk (only used with AWS HSM)
      --ca string                       googleca | pkcs11ca | ephemeralca (for testing)
      --config-path string              path to fulcio config json (default "/etc/fulcio-config/config.json")
      --ct-log-url string               host and path (with log prefix at the end) to the ct log (default "http://localhost:6962/test")
      --gcp_private_ca_parent string    private ca parent: /projects/<project>/locations/<location>/<name> (only used with --ca googleca)
      --gcp_private_ca_version string   private ca version: [v1|v1beta1] (only used with --ca googleca) (default "v1")
      --host string                     The host on which to serve requests (default "0.0.0.0")
      --hsm-caroot-id string            HSM ID for Root CA (only used with --ca pkcs11ca)
      --log_type string                 logger type to use (dev/prod) (default "dev")
      --pkcs11-config-path string       path to fulcio pkcs11 config file (default "config/crypto11.conf")
      --port string                     The port on which to serve requests (default "8080")

NB: The flags like --port that are completely irrelevant to createca and are only needed for serve

After

fulcio createca -h
Create an x509 root CA within a pkcs11 device using values
such as organization, country etc. This can then be used as the root
certificate authority for an instance of sigstore fulcio

Usage:
  fulcio createca [flags]

Flags:
      --country string              Country name for root CA
  -h, --help                        help for createca
      --hsm string                  The HSM provider to use. Valid values: softhsm (default), aws (default "softhsm")
      --hsm-caroot-id string        HSM ID for Root CA
      --locality string             Locality name for root CA
      --org string                  Organization name for root CA (default "Fulcio Root CA")
      --out string                  output root CA to file
      --pkcs11-config-path string   path to fulcio pkcs11 config file (default "config/crypto11.conf")
      --postal-code string          Postal code for root CA
      --province string             Province name for root CA
      --street-address string       Street address for root CA

Ticket Link

Fixes #273

Release Note

* Removed global flags from CLI and moved flags to their relevant subcommands

@nsmith5 nsmith5 force-pushed the ns/localize-flagging-on-subcmd branch from 7be7eeb to 79309e9 Compare December 12, 2021 02:12
This makes it more clear which flag is for which subcommand.

Signed-off-by: Nathan Smith <nathan@nfsmith.ca>
@nsmith5 nsmith5 force-pushed the ns/localize-flagging-on-subcmd branch from 79309e9 to 582d59d Compare December 12, 2021 02:26
@dlorenc
Copy link
Member

dlorenc commented Dec 12, 2021

Thanks for the contributions!

@dlorenc dlorenc merged commit 6ff4fbf into sigstore:main Dec 12, 2021
@nsmith5 nsmith5 deleted the ns/localize-flagging-on-subcmd branch December 12, 2021 16:12
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.

Move global flags to their relevant subcommands
2 participants