-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: add doc command #66 #209
Conversation
lib/PromptSession.ts
Outdated
@@ -265,3 +265,20 @@ export class PromptSession { | |||
return answers; | |||
} | |||
} | |||
|
|||
export function chooseTerm() { | |||
return inquirer.prompt({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use await
to cut down on promise handlers :)
const answers = await inquirer.prompt(...
lib/PromptSession.ts
Outdated
@@ -265,3 +265,20 @@ export class PromptSession { | |||
return answers; | |||
} | |||
} | |||
|
|||
export function chooseTerm() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this one should be marked as async
really (though await will force it anyway)
Just for style sake, I'd prefer if the extra function was part of the class itself (matching exported class to file name thing), could be static.
lib/commands/doc.ts
Outdated
} else { | ||
Util.error(`Review your search results in the browser`, "green"); | ||
return (argv.extended) ? | ||
doc.open(`https://www.google.com/search?q=site%3Aigniteui.com\\%20infragistics.com+${argv.term}`) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One too many?
lib/commands/doc.ts
Outdated
}, | ||
async execute(argv) { | ||
if (!argv.term) { | ||
await chooseTerm().then(answer => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for then if you use await
2984585
to
bf61a1a
Compare
Closes #66
bf61a1a
to
d19ef81
Compare
#66
Add doc command, allowing users to search the infragistics help for a given term