Skip to content

Commit

Permalink
Improve auth0 qs download docs (#673)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught authored Mar 14, 2023
1 parent 6628fbb commit 0ff550a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
11 changes: 7 additions & 4 deletions docs/auth0_quickstarts_download.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,20 @@ auth0 quickstarts download [flags]
## Examples

```
auth0 quickstarts download --stack <stack>
auth0 qs download -s <stack>
auth0 qs download -s "Next.js"
auth0 quickstarts download
auth0 quickstarts download <app-id>
auth0 quickstarts download <app-id> --stack <stack>
auth0 qs download <app-id> -s <stack>
auth0 qs download <app-id> -s "Next.js"
auth0 qs download <app-id> -s "Next.js" --force
```


## Flags

```
--force Skip confirmation.
-s, --stack string Tech/Language of the quickstart sample to download.
-s, --stack string Tech/language of the Quickstart sample to download. You can use the 'auth0 quickstarts list' command to see all available tech stacks.
```


Expand Down
8 changes: 7 additions & 1 deletion internal/cli/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/auth0/auth0-cli/internal/ansi"
"github.com/auth0/auth0-cli/internal/auth0"
"github.com/auth0/auth0-cli/internal/display"
"github.com/auth0/auth0-cli/internal/prompt"
)

Expand Down Expand Up @@ -885,7 +886,12 @@ func (c *cli) appPickerOptions(requestOpts ...management.RequestOption) pickerOp
var priorityOpts, opts pickerOptions
for _, client := range clientList.Clients {
value := client.GetClientID()
label := fmt.Sprintf("%s %s", client.GetName(), ansi.Faint("("+value+")"))
label := fmt.Sprintf(
"%s [%s] %s",
client.GetName(),
display.ApplyColorToFriendlyAppType(display.FriendlyAppType(client.GetAppType())),
ansi.Faint("("+value+")"),
)
option := pickerOption{value: value, label: label}

if tenant.DefaultAppID == client.GetClientID() {
Expand Down
18 changes: 11 additions & 7 deletions internal/cli/quickstarts.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ var (
}

qsStack = Flag{
Name: "Stack",
LongForm: "stack",
ShortForm: "s",
Help: "Tech/Language of the quickstart sample to download.",
Name: "Stack",
LongForm: "stack",
ShortForm: "s",
Help: "Tech/language of the Quickstart sample to download. " +
"You can use the 'auth0 quickstarts list' command to see all available tech stacks. ",
IsRequired: true,
}
)
Expand Down Expand Up @@ -98,9 +99,12 @@ func downloadQuickstartCmd(cli *cli) *cobra.Command {
Short: "Download a Quickstart sample app for a specific tech stack",
Long: "Download a Quickstart sample application for that’s already configured for your Auth0 application. " +
"There are many different tech stacks available.",
Example: ` auth0 quickstarts download --stack <stack>
auth0 qs download -s <stack>
auth0 qs download -s "Next.js"`,
Example: ` auth0 quickstarts download
auth0 quickstarts download <app-id>
auth0 quickstarts download <app-id> --stack <stack>
auth0 qs download <app-id> -s <stack>
auth0 qs download <app-id> -s "Next.js"
auth0 qs download <app-id> -s "Next.js" --force`,
RunE: downloadQuickstart(cli, &inputs),
}

Expand Down

0 comments on commit 0ff550a

Please sign in to comment.