Skip to content

Commit

Permalink
Added -v flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
liam-ilan committed Oct 2, 2023
1 parent 5b0f810 commit 6fc6daa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,11 @@ Comments start with "//", and end with the end of a line, for example:
```

## Development
To identify the current interpreter version, use the `-v` flag.
```bash
./crumb -v
```

When debugging the interpreter, it may be useful to compile with the `-g` flag.
```bash
gcc src/*.c -g -Wall -lm -o crumb
Expand Down
6 changes: 6 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ int main(int argc, char *argv[]) {
codePath = argv[2];
}

// version help
if (strcmp(argv[1], "-v") == 0) {
printf("v0.0.2\n");
return 0;
}

/* read file */
if (debug) printf("\nCODE\n");

Expand Down

0 comments on commit 6fc6daa

Please sign in to comment.