Skip to content

Commit

Permalink
readme update, started help cmd option
Browse files Browse the repository at this point in the history
  • Loading branch information
jweinst1 committed Jun 13, 2018
1 parent 73fa61f commit cd87adc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,15 @@ ________________________

#### `-t`:

The `-t` flag allows for a string of `Wind` code to be run and timed.
The `-t` flag allows for a string of `Wind` code to be run and timed:

```
Wind -t "push 5 3 4 -> reduce + -> out -> push 6 6 6 6 6 6 6 -> reduce + -> out -> push 6 5 -> map * 7 -> reduce + -> out"
[ 12 ]
[ 54 ]
[ 455 ]
Time: 0.000081
```


## Stage
Expand Down
4 changes: 4 additions & 0 deletions include/LangInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@

#define LangInfo_REPL_INS "The Wind Programming Language REPL\nTo exit, simply enter 'exit'.\n"

#define LangInfo_HELP "The Wind Programming Language Help Guide\n \
clr command: \n \
The clr command resets the active data.\n"

#endif
7 changes: 6 additions & 1 deletion src/main/Main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "IOUtil.h"
#include "WindRun.h"
#include "LangInfo.h"


int main(int argc, char const *argv[]) {
Expand All @@ -14,7 +15,7 @@ int main(int argc, char const *argv[]) {
}
if(argc > 3)
{
fprintf(stderr, "Error, need two or no command line arguments, got %d\n", argc - 1);
fprintf(stderr, "Error, need two or less arguments, got %d\n", argc - 1);
exit(1);
}
else if(!strcmp(argv[1], "-c"))
Expand All @@ -36,6 +37,10 @@ int main(int argc, char const *argv[]) {
WindRun_code(argv[2]);
IOUtil_debug();
}
else if(!strcmp(argv[1], "-h"))
{
printf(LangInfo_HELP);
}
else
{
fprintf(stderr, "Error, option not recognized found option %s\n", argv[1]);
Expand Down

0 comments on commit cd87adc

Please sign in to comment.