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

fix(login): fixed short-form of --clear-credentials flag #614

Merged
merged 1 commit into from Dec 6, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/www/docs/cli/swa-deploy.md
Expand Up @@ -168,7 +168,7 @@ Here are the options you can use with `swa deploy`:
- `-C, --client-id <clientId>`: Azure client ID
- `-CS, --client-secret <clientSecret>`: Azure client secret
- `-n, --app-name <appName>`: Azure Static Web App application name
- `-cc, --clear-credentials`: clear persisted credentials before login (default: `false`)
- `-CC, --clear-credentials`: clear persisted credentials before login (default: `false`)
- `-u, --use-keychain`: enable using the operating system native keychain for persistent credentials (default: `true`)
- `-nu, --no-use-keychain`: disable using the operating system native keychain
- `-h, --help`: display help for command
Expand Down
2 changes: 1 addition & 1 deletion docs/www/docs/cli/swa-login.md
Expand Up @@ -25,7 +25,7 @@ Here are the options you can use with `swa login`:
- `-C, --client-id <clientId>`: Azure client ID
- `-CS, --client-secret <clientSecret>`: Azure client secret
- `-n, --app-name <appName>`: Azure Static Web App application name
- `-cc, --clear-credentials`: clear persisted credentials before login (default: `false`)
- `-CC, --clear-credentials`: clear persisted credentials before login (default: `false`)
- `-u, --use-keychain`: enable using the operating system native keychain for persistent credentials (default: `true`)
- `-u, --no-use-keychain`: disable using the operating system native keychain
- `-h, --help`: display help for command
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/login.ts
Expand Up @@ -20,7 +20,7 @@ export function addSharedLoginOptionsToCommand(command: Command) {
.option("-C, --client-id <clientId>", "Azure client ID", DEFAULT_CONFIG.clientId)
.option("-CS, --client-secret <clientSecret>", "Azure client secret", DEFAULT_CONFIG.clientSecret)
.option("-n, --app-name <appName>", "Azure Static Web App application name", DEFAULT_CONFIG.appName)
.option("-cc, --clear-credentials", "clear persisted credentials before login", DEFAULT_CONFIG.clearCredentials)
.option("-CC, --clear-credentials", "clear persisted credentials before login", DEFAULT_CONFIG.clearCredentials)

.option("-u, --use-keychain", "enable using the operating system native keychain for persistent credentials", DEFAULT_CONFIG.useKeychain)
// Note: Commander does not automatically recognize the --no-* option, so we have to explicitly use --no-use-keychain- instead
Expand Down
4 changes: 2 additions & 2 deletions src/core/utils/options.spec.ts
Expand Up @@ -231,7 +231,7 @@ describe("Testing aliases for each of the commands and their options", () => {
.option("-C, --client-id [clientId]")
.option("-CS, --client-secret [clientSecret]")
.option("-n, --app-name [appName]")
.option("-cc, --clear-credentials")
.option("-CC, --clear-credentials")
.option("-u, --use-keychain")
.option("-nu, --no-use-keychain")
.parseAsync([
Expand All @@ -249,7 +249,7 @@ describe("Testing aliases for each of the commands and their options", () => {
"clientSecret",
"-n",
"appName",
"-cc",
"-CC",
"-nu",
]);

Expand Down