-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: cloud: Add examples to the commands
- Loading branch information
Showing
13 changed files
with
99 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* eslint-disable no-console */ | ||
/* eslint-disable no-console, no-multi-str */ | ||
import yargs from 'yargs'; | ||
import chalk from 'chalk'; | ||
import { Authenticator } from '@cesarbr/knot-cloud-sdk-js'; | ||
|
@@ -18,7 +18,17 @@ yargs.command({ | |
command: 'create-token <email> <credential> <type>', | ||
desc: 'Create a new user or app token', | ||
builder: (_yargs) => { | ||
_yargs.options(options.http); | ||
_yargs.options(options.http).example([ | ||
[ | ||
'$0 create-token [email protected] strong@password! user --http-server api.fog', | ||
'Create a new `user` token for the `[email protected]` user.', | ||
], | ||
[ | ||
'$0 create-token [email protected] <user-token> app --http-server api.fog', | ||
'Create a new `app` token for the `[email protected]` user. The \ | ||
`user` token previously created must by passed as password for creating an `app` token.', | ||
], | ||
]); | ||
}, | ||
handler: async (args) => { | ||
try { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,13 @@ yargs.command({ | |
desc: 'Create a new user', | ||
builder: (_yargs) => { | ||
_yargs | ||
.options(options.http); | ||
.options(options.http) | ||
.example([ | ||
[ | ||
'$0 create-user [email protected] strong@password! --http-server api.fog', | ||
'Create a new user with e-mail `[email protected]` and password `strong@password!`', | ||
], | ||
]); | ||
}, | ||
handler: async (args) => { | ||
await createUser(args); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters