Update CLI doc strings

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2024-07-10 09:00:56 +02:00
parent 3f737240fc
commit 1be9959cf5
No known key found for this signature in database
GPG Key ID: 7DD3015F3DDE4B9C
4 changed files with 6 additions and 6 deletions

View File

@ -21,9 +21,9 @@ import (
func newCompareCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "compare {aws-sev-snp|azure-sev-snp|azure-tdx|gcp-sev-snp} [FILE] [FILE] ...",
Short: "Compare two or more attestation reports and return the lowest version",
Long: "Compare two or more attestation reports and return the lowest version.",
Use: "compare VARIANT FILE FILE [FILE...]",
Short: "Returns the minimum version of all given attestation reports.",
Long: "Compare two or more attestation reports and return the report with the minimum version of all given attestation reports.",
Example: "cli compare azure-sev-snp report1.json report2.json",
Args: cobra.MatchAll(cobra.MinimumNArgs(3), arg0isAttestationVariant()),
RunE: runCompare,

View File

@ -26,7 +26,7 @@ import (
// newDeleteCmd creates the delete command.
func newDeleteCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "delete {aws-sev-snp|azure-sev-snp|azure-tdx|gcp-sev-snp} {attestation-report|guest-firmware} <version>",
Use: "delete VARIANT KIND <version>",
Short: "Delete an object from the attestationconfig API",
Long: "Delete a specific object version from the config api. <version> is the name of the object to delete (without .json suffix)",
Example: "COSIGN_PASSWORD=$CPW COSIGN_PRIVATE_KEY=$CKEY cli delete azure-sev-snp attestation-report 1.0.0",

View File

@ -29,7 +29,7 @@ import (
func newUploadCmd() *cobra.Command {
uploadCmd := &cobra.Command{
Use: "upload {aws-sev-snp|azure-sev-snp|azure-tdx|gcp-sev-snp} {attestation-report|guest-firmware} <path>",
Use: "upload VARIANT KIND FILE",
Short: "Upload an object to the attestationconfig API",
Long: fmt.Sprintf("Upload a new object to the attestationconfig API. For snp-reports the new object is added to a cache folder first.\n"+

View File

@ -33,7 +33,7 @@ func arg0isAttestationVariant() cobra.PositionalArgs {
func isValidKind(arg int) cobra.PositionalArgs {
return func(_ *cobra.Command, args []string) error {
if kind := kindFromString(args[arg]); kind == unknown {
return fmt.Errorf("argument %s isn't a valid kind", args[arg])
return fmt.Errorf("argument %s isn't a valid kind: must be one of [%q, %q]", args[arg], attestationReport, guestFirmware)
}
return nil
}