Skip to content

Commit

Permalink
Merge pull request JaiMaaSheeravali#29 from JaiMaaSheeravali/gog
Browse files Browse the repository at this point in the history
enable google using google <word_to_search>
  • Loading branch information
guptaprakhariitr authored May 10, 2021
2 parents be82712 + d288147 commit b2243ca
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/builtin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ int (*builtin_func[])(char **, int) = {
&roosh_rsh,
&roosh_google,
&roosh_exec_tutorial,
&roosh_calc
};
&roosh_calc};

// vector to store history of list of commands
vector<string> list_cmds;
Expand Down Expand Up @@ -241,14 +240,19 @@ int roosh_google(char **args, int num_args)
else
google_a_description(args[1], args[2]);
}
else if (num_args == 2)
{
google_a_description(args[1], "en_US");
}
else
{
cout << "Please use google --help for any help.\n";
}
return 1;
}

int roosh_calc(char **args, int num_args){
int roosh_calc(char **args, int num_args)
{
// 2 argumets required
// first is the calc command
// second is the expresssiongi
Expand All @@ -263,10 +267,10 @@ int roosh_calc(char **args, int num_args){
return 1;
}

// tinyexpr evaluates the
// tinyexpr evaluates the

double answer = te_interp(args[1], 0);
cout << answer << endl;

return 1;
}

0 comments on commit b2243ca

Please sign in to comment.