Initial Commit

This commit is contained in:
logen 2016-07-18 20:01:16 -07:00
commit bb13744baf
2 changed files with 37 additions and 0 deletions

10
README.md Normal file
View File

@ -0,0 +1,10 @@
# Euhelp
## Search Open Euphoria Docs quickly
```
$ cc euhelp.c -o euhelp
```
```
$ ./euhelp SearchTerm
```

27
euhelp.c Normal file
View File

@ -0,0 +1,27 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
char command[1024];
//xdg-open was pissed about escaped quotes so I had to go with %22
//added %5c in order to open first search result
strcpy(command,"xdg-open https://duckduckgo.com/?q=\%5Csite\%3Ahttp\%3A\%2F\%2Fopeneuphoria.org\%2Fdocs\%2F+\%22");
if (argc >=1){
strcat(command, argv[1]);
}
if (argc >=3){
printf("Multiple search terms not implemented yet\n If you wish to do this anyway, please use a \"+\" instead of a space \n");
exit(1);
}
strcat(command, "\%22");
printf("%s", command);
system(command);
return 0;
}