Skip to content

Commit

Permalink
correcting username positional
Browse files Browse the repository at this point in the history
  • Loading branch information
nephh committed Jan 10, 2024
1 parent e215aa0 commit 9edd75c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -629,17 +629,17 @@ import yargs from 'yargs/yargs';
import { hideBin } from 'yargs/helpers';
import { input } from '@inquirer/prompts';

yargs(hideBin(process.argv))
await yargs(hideBin(process.argv))
.command({
command: 'login [username]',
describe: 'Log in with defined username',
builder: {
username: {
describe: 'username',
builder: (yargs) => {
yargs.positional('username', {
describe: 'The username used to log in',
type: 'string',
},
});
},
handler: async function (argv) {
handler: async (argv) => {
if (!argv.username) {
argv.username = await input({ message: 'Please enter your username' });
}
Expand Down

0 comments on commit 9edd75c

Please sign in to comment.