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

feat: add doc command #66 #209

Merged
merged 1 commit into from
Mar 8, 2018
Merged

feat: add doc command #66 #209

merged 1 commit into from
Mar 8, 2018

Conversation

ViktorSlavov
Copy link
Contributor

#66

Add doc command, allowing users to search the infragistics help for a given term

@coveralls
Copy link

coveralls commented Mar 7, 2018

Coverage Status

Coverage increased (+0.02%) to 60.904% when pulling d19ef81 on vslavov/66-doc-command into 3a36768 on master.

@@ -265,3 +265,20 @@ export class PromptSession {
return answers;
}
}

export function chooseTerm() {
return inquirer.prompt({
Copy link
Member

@damyanpetev damyanpetev Mar 7, 2018

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(...

@@ -265,3 +265,20 @@ export class PromptSession {
return answers;
}
}

export function chooseTerm() {
Copy link
Member

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.

} 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}`) :
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One too many?

},
async execute(argv) {
if (!argv.term) {
await chooseTerm().then(answer => {
Copy link
Member

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

@ViktorSlavov ViktorSlavov force-pushed the vslavov/66-doc-command branch 3 times, most recently from 2984585 to bf61a1a Compare March 7, 2018 15:24
@ViktorSlavov ViktorSlavov force-pushed the vslavov/66-doc-command branch from bf61a1a to d19ef81 Compare March 7, 2018 15:44
@bazal4o bazal4o merged commit 1445d54 into master Mar 8, 2018
@damyanpetev damyanpetev deleted the vslavov/66-doc-command branch March 8, 2018 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants