Skip to content

Commit

Permalink
Replace all usage of CmdBuilderWithDocs with CmdBuilder.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsomething committed Mar 10, 2020
1 parent b150a18 commit d34952c
Show file tree
Hide file tree
Showing 27 changed files with 181 additions and 181 deletions.
4 changes: 2 additions & 2 deletions commands/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ For example, ` + "`" + `doctl account get` + "`" + ` retrieves account profile d
},
}

CmdBuilderWithDocs(cmd, RunAccountGet, "get", "Retrieve account profile details", `Retrieve the following details from your account profile:
CmdBuilder(cmd, RunAccountGet, "get", "Retrieve account profile details", `Retrieve the following details from your account profile:
- Email address
- Account Droplet limit
Expand All @@ -39,7 +39,7 @@ For example, ` + "`" + `doctl account get` + "`" + ` retrieves account profile d
- UUID for the account.`, Writer,
aliasOpt("g"), displayerType(&displayers.Account{}))

CmdBuilderWithDocs(cmd, RunAccountRateLimit, "ratelimit", "Retrieve your API usage and the remaining quota", `Retrieve the following details about your account's API usage:
CmdBuilder(cmd, RunAccountRateLimit, "ratelimit", "Retrieve your API usage and the remaining quota", `Retrieve the following details about your account's API usage:
- The current limit on your account for API calls (5,000 per hour per OAuth token)
- The number of API calls you have made in the last hour
Expand Down
6 changes: 3 additions & 3 deletions commands/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ This can be filtered to a specific action. For example, while ` + "`" + `doctl c
- The resource type (Droplet, backend)
- The region in which the action took place (nyc3, sfo2, etc)`

CmdBuilderWithDocs(cmd, RunCmdActionGet, "get <action-id>", "Retrieve details about a specific action", `This command retrieves the following details about a specific action taken on one of your resources:`+actionDetails, Writer,
CmdBuilder(cmd, RunCmdActionGet, "get <action-id>", "Retrieve details about a specific action", `This command retrieves the following details about a specific action taken on one of your resources:`+actionDetails, Writer,
aliasOpt("g"), displayerType(&displayers.Action{}))

cmdActionList := CmdBuilderWithDocs(cmd, RunCmdActionList, "list", "Retrieve a list of all recent actions taken on your resources", `This command retrieves a list of all actions taken on your resources. The following details are provided:`+actionDetails, Writer,
cmdActionList := CmdBuilder(cmd, RunCmdActionList, "list", "Retrieve a list of all recent actions taken on your resources", `This command retrieves a list of all actions taken on your resources. The following details are provided:`+actionDetails, Writer,
aliasOpt("ls"), displayerType(&displayers.Action{}))
AddStringFlag(cmdActionList, doctl.ArgActionResourceType, "", "", "Action resource type")
AddStringFlag(cmdActionList, doctl.ArgActionRegion, "", "", "Action region")
Expand All @@ -59,7 +59,7 @@ This can be filtered to a specific action. For example, while ` + "`" + `doctl c
AddStringFlag(cmdActionList, doctl.ArgActionStatus, "", "", "Action status")
AddStringFlag(cmdActionList, doctl.ArgActionType, "", "", "Action type")

cmdActionWait := CmdBuilderWithDocs(cmd, RunCmdActionWait, "wait <action-id>", "Block thread until an action completes", `The command blocks the current thread, returning when an action completes.
cmdActionWait := CmdBuilder(cmd, RunCmdActionWait, "wait <action-id>", "Block thread until an action completes", `The command blocks the current thread, returning when an action completes.
For example, if you find an action when calling `+"`"+`doctl compute action list`+"`"+` that has a status of `+"`"+`in-progress`+"`"+`, you can note the action ID and call `+"`"+`doctl compute action wait <action-id>`+"`"+`, and doctl will appear to "hang" until the action has completed. This can be useful for scripting purposes.`, Writer,
aliasOpt("w"), displayerType(&displayers.Action{}))
Expand Down
2 changes: 1 addition & 1 deletion commands/balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func Balance() *Command {
- The time at which balances were most recently generated.
`

CmdBuilderWithDocs(cmd, RunBalanceGet, "get", "Retrieve your account balance",
CmdBuilder(cmd, RunBalanceGet, "get", "Retrieve your account balance",
getBalanceDesc, Writer, aliasOpt("g"), displayerType(&displayers.Balance{}))

return cmd
Expand Down
12 changes: 6 additions & 6 deletions commands/cdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,33 @@ The Time To Live (TTL) value is the length of time in seconds that a file is cac
TTLDesc := "The \"Time To Live\" (TTL) value for cached content, in seconds"
DomainDesc := "Specify a custom domain to use with the CDN"
CertIDDesc := "Specify a Certificate ID for the custom domain"
CmdBuilderWithDocs(cmd, RunCDNList, "list", "List CDNs that have already been created", `Lists the following details for Content Delivery Networks (CDNs) that have already been created:`+CDNDetails, Writer,
CmdBuilder(cmd, RunCDNList, "list", "List CDNs that have already been created", `Lists the following details for Content Delivery Networks (CDNs) that have already been created:`+CDNDetails, Writer,
aliasOpt("ls"), displayerType(&displayers.CDN{}))

cmdCDNCreate := CmdBuilderWithDocs(cmd, RunCDNCreate, "create <cdn-origin>", "Create a CDN", `This command creates a Content Delivery Network (CDN) on the origin server you specify and automatically generates an endpoint. You can also use a custom subdomain you own to create an additional endpoint, which must be secured with SSL.`+CDNnotes, Writer,
cmdCDNCreate := CmdBuilder(cmd, RunCDNCreate, "create <cdn-origin>", "Create a CDN", `This command creates a Content Delivery Network (CDN) on the origin server you specify and automatically generates an endpoint. You can also use a custom subdomain you own to create an additional endpoint, which must be secured with SSL.`+CDNnotes, Writer,
aliasOpt("c"), displayerType(&displayers.CDN{}))
AddIntFlag(cmdCDNCreate, doctl.ArgCDNTTL, "", 3600, TTLDesc)
AddStringFlag(cmdCDNCreate, doctl.ArgCDNDomain, "", "", DomainDesc)
AddStringFlag(cmdCDNCreate, doctl.ArgCDNCertificateID, "", "", CertIDDesc)

cmdRunCDNDelete := CmdBuilderWithDocs(cmd, RunCDNDelete, "delete <cdn-id>", "Delete a CDN", `This command deletes the CDN specified by the ID.
cmdRunCDNDelete := CmdBuilder(cmd, RunCDNDelete, "delete <cdn-id>", "Delete a CDN", `This command deletes the CDN specified by the ID.
You can retrieve the ID by calling `+"`"+`doctl compute cdn list`+"`"+` if needed.`, Writer,
aliasOpt("rm"))
AddBoolFlag(cmdRunCDNDelete, doctl.ArgForce, doctl.ArgShortForce, false, "Delete the specified CDN without prompting for confirmation")

CmdBuilderWithDocs(cmd, RunCDNGet, "get <cdn-id>", "Retrieve details about a specific CDN", `This command lists the following details for the Content Delivery Network (CDNs) specified by the ID:`+CDNDetails+CDNnotes, Writer, aliasOpt("g"),
CmdBuilder(cmd, RunCDNGet, "get <cdn-id>", "Retrieve details about a specific CDN", `This command lists the following details for the Content Delivery Network (CDNs) specified by the ID:`+CDNDetails+CDNnotes, Writer, aliasOpt("g"),
displayerType(&displayers.CDN{}))

cmdCDNUpdate := CmdBuilderWithDocs(cmd, RunCDNUpdate, "update <cdn-id>", "Update the configuration for a CDN", `This command allows you to update the configuration details of an existing Content Delivery Network (CDN).
cmdCDNUpdate := CmdBuilder(cmd, RunCDNUpdate, "update <cdn-id>", "Update the configuration for a CDN", `This command allows you to update the configuration details of an existing Content Delivery Network (CDN).
Currently, you can only update the custom domain and its certificate ID with this command.`, Writer,
aliasOpt("u"), displayerType(&displayers.CDN{}))
AddIntFlag(cmdCDNUpdate, doctl.ArgCDNTTL, "", 3600, TTLDesc)
AddStringFlag(cmdCDNUpdate, doctl.ArgCDNDomain, "", "", DomainDesc)
AddStringFlag(cmdCDNUpdate, doctl.ArgCDNCertificateID, "", "", CertIDDesc)

cmdCDNFlushCache := CmdBuilderWithDocs(cmd, RunCDNFlushCache, "flush <cdn-id>", "Flush the cache of a CDN", `This command flushes the cache of a Content Delivery Network (CDN), which:
cmdCDNFlushCache := CmdBuilder(cmd, RunCDNFlushCache, "flush <cdn-id>", "Flush the cache of a CDN", `This command flushes the cache of a Content Delivery Network (CDN), which:
- purges all copies of the files in the cache
- re-caches the files
Expand Down
8 changes: 4 additions & 4 deletions commands/certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ Once a certificate has been stored, it is assigned a unique certificate ID that
- The certificate type (` + "`" + `custom` + "`" + ` or ` + "`" + `lets_encrypt` + "`" + `)
- The certificate state (` + "`" + `pending` + "`" + `, ` + "`" + `verified` + "`" + `, or ` + "`" + `error` + "`" + `)`

CmdBuilderWithDocs(cmd, RunCertificateGet, "get <id>", "Retrieve details about a certificate", `This command retrieves the following details about a certificate:`+certDetails, Writer,
CmdBuilder(cmd, RunCertificateGet, "get <id>", "Retrieve details about a certificate", `This command retrieves the following details about a certificate:`+certDetails, Writer,
aliasOpt("g"), displayerType(&displayers.Certificate{}))
cmdCertificateCreate := CmdBuilderWithDocs(cmd, RunCertificateCreate, "create",
cmdCertificateCreate := CmdBuilder(cmd, RunCertificateCreate, "create",
"Create a new certificate", `This command allows you to create a certificate. There are two supported certificate types: Let's Encrypt certificates, and custom certificates.
Let's Encrypt certificates are free and will be auto-renewed and managed for you by DigitalOcean.
Expand All @@ -74,10 +74,10 @@ To upload a custom certificate, you'll need to provide a certificate name, the p
AddStringFlag(cmdCertificateCreate, doctl.ArgCertificateType, "", "",
"Certificate type [custom|lets_encrypt]")

CmdBuilderWithDocs(cmd, RunCertificateList, "list", "Retrieve list of the account's stored certificates", `This command retrieves a list of all certificates associated with the account. The following details are shown for each certificate:`+certDetails, Writer,
CmdBuilder(cmd, RunCertificateList, "list", "Retrieve list of the account's stored certificates", `This command retrieves a list of all certificates associated with the account. The following details are shown for each certificate:`+certDetails, Writer,
aliasOpt("ls"), displayerType(&displayers.Certificate{}))

cmdCertificateDelete := CmdBuilderWithDocs(cmd, RunCertificateDelete, "delete <id>",
cmdCertificateDelete := CmdBuilder(cmd, RunCertificateDelete, "delete <id>",
"Delete the specified certificate", `This command deletes the specified certificate.
Use `+"`"+`doctl compute certificate list`+"`"+` to see all available certificates associated with your account.`, Writer, aliasOpt("d", "rm"))
Expand Down
Loading

0 comments on commit d34952c

Please sign in to comment.