in cli_tools/gce_ovf_export/domain/args.go [188:236]
func (args *OVFExportArgs) registerFlags(cliArgs []string) error {
flagSet := flag.NewFlagSet("ovf-export", flag.ContinueOnError)
// Don't write parse errors to stdout, instead propagate them via an
// exception since we use flag.ContinueOnError.
flagSet.SetOutput(ioutil.Discard)
flagSet.Var((*flags.TrimmedString)(&args.InstanceName), InstanceNameFlagKey,
"Name of the VM Instance to be exported.")
flagSet.Var((*flags.TrimmedString)(&args.MachineImageName), MachineImageNameFlagKey,
"Name of the Google machine image to be exported.")
flagSet.Var((*flags.LowerTrimmedString)(&args.ClientID), ClientIDFlagKey,
"Identifies the client of the exporter, e.g. `gcloud` or `pantheon`")
flagSet.Var((*flags.TrimmedString)(&args.ClientVersion), "client-version",
"Identifies the version of the client of the exporter.")
flagSet.Var((*flags.TrimmedString)(&args.DestinationURI), DestinationURIFlagKey,
"Google Cloud Storage URI of the OVF descriptor or directory to export to. For example: `gs://my-bucket/my-vm.ovf` or `gs://my-bucket/my-ovf/`.")
flagSet.Var((*flags.LowerTrimmedString)(&args.DiskExportFormat), "disk-export-format",
"format for disks in OVF, such as vmdk, vhdx, vpc, or qcow2. Any format supported by qemu-img is supported by OVF export. Defaults to `vmdk`.")
flagSet.Var((*flags.TrimmedString)(&args.Network), "network",
"Name of the network in your project to use for the image export. The network must have access to Google Cloud Storage. If not specified, the network named default is used. If -subnet is also specified subnet must be a subnetwork of network specified by -network.")
flagSet.Var((*flags.TrimmedString)(&args.Subnet), "subnet",
"Name of the subnetwork in your project to use for the image export. If the network resource is in legacy mode, do not provide this property. If the network is in auto subnet mode, providing the subnetwork is optional. If the network is in custom subnet mode, then this field should be specified. zone should be specified if this field is specified.")
flagSet.BoolVar(&args.NoExternalIP, "no-external-ip", false,
"Specifies that VPC used for OVF export doesn't allow external IPs.")
flagSet.Var((*flags.TrimmedString)(&args.OsID), "os",
"Specifies the OS of the image being exported. OS must be one of: "+strings.Join(daisyutils.GetSortedOSIDs(), ", ")+".")
flagSet.Var((*flags.TrimmedString)(&args.Zone), "zone",
"zone of the image to export. The zone in which to do the work of exporting the image. Overrides the default compute/zone property value for this command invocation")
flagSet.DurationVar(&args.Timeout, "timeout", time.Hour*2,
"Maximum time a build can last before it is failed as TIMEOUT. For example, specifying 2h will fail the process after 2 hours. See `gcloud topic datetimes` for information on duration formats")
flagSet.Var((*flags.TrimmedString)(&args.Project), "project",
"project to run in, overrides what is set in workflow")
flagSet.Var((*flags.TrimmedString)(&args.ScratchBucketGcsPath), "scratch-bucket-gcs-path",
"GCS scratch bucket to use, overrides what is set in workflow")
flagSet.Var((*flags.TrimmedString)(&args.Oauth), "oauth",
"path to oauth json file, overrides what is set in workflow")
flagSet.Var((*flags.TrimmedString)(&args.Ce), "compute-endpoint-override", "API endpoint to override default")
flagSet.BoolVar(&args.GcsLogsDisabled, "disable-gcs-logging", false, "do not stream logs to GCS")
flagSet.BoolVar(&args.CloudLogsDisabled, "disable-cloud-logging", false, "do not stream logs to Cloud Logging")
flagSet.BoolVar(&args.StdoutLogsDisabled, "disable-stdout-logging", false, "do not display individual workflow logs on stdout")
flagSet.Var((*flags.TrimmedString)(&args.ReleaseTrack), ReleaseTrackFlagKey,
fmt.Sprintf("Release track of OVF export. One of: %s, %s or %s. Impacts which compute API release track is used by the export tool.", Alpha, Beta, GA))
flagSet.Var((*flags.TrimmedString)(&args.BuildID), "build-id",
"Cloud Build ID override. This flag should be used if auto-generated or build ID provided by Cloud Build is not appropriate. For example, if running multiple exports in parallel in a single Cloud Build run, sharing build ID could cause premature temporary resource clean-up resulting in export failures.")
flagSet.Var((*flags.TrimmedString)(&args.ComputeServiceAccount), "compute-service-account", "Compute service account to be used by exporter Virtual Machine. When empty, the Compute Engine default service account is used.")
flagSet.BoolVar(&args.NestedVirtualizationEnabled, "enable-nested-virtualization", true, "When enabled, temporary worker VMs will be created with enabled nested virtualization. See https://cloud.google.com/compute/docs/instances/nested-virtualization/enabling for details.")
flagSet.Var((*flags.StringArrayFlag)(&args.WorkerMachineSeries), "worker-machine-series", "The export tool automatically selects the machine series for temporary worker VMs based on the execution context. The argument overrides this behavior and specifies the machine series to use for worker VMs. Additionally it is possible to specify fallback machine series by setting this argument twice. For example, -worker-machine-series n1 -worker-machine-series n2")
return flagSet.Parse(cliArgs)
}