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

Improve auth0 qs download docs #673

Merged
merged 1 commit into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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