Skip to content

Commit 901cb46

Browse files
committed
Added instructions for CLI usage
1 parent d15a4a4 commit 901cb46

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

README.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,29 @@ Both for ease of use, and because I might end up using the nightly toolchain (th
1313

1414
### Running the project
1515

16-
Now that I've implemented the unit tests, the `main` function does nothing. In the future, it will input `stdin` to the parser. For the moment, please run the tests instead.
16+
First, build the project.
17+
18+
```bash
19+
cargo build
20+
```
21+
22+
Then, run it feeding it some code:
23+
24+
```bash
25+
target/debug/tiny-c-parser -p code_samples/do_while_example.tc
26+
```
27+
28+
You can also check the included usage help:
29+
30+
```bash
31+
target/debug/tiny-c-parser --help
32+
```
1733

1834
### Running the tests
1935

2036
To run the unit tests:
2137

22-
`cargo test`
38+
```bash
39+
cargo test
40+
```
2341

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ fn main() {
294294
let parse_result = parse_tc_file(&unparsed_file);
295295

296296
match parse_result {
297-
Ok(ast) => println!("AST: {:?}", ast),
297+
Ok(ast) => println!("AST: \n {:?}", ast),
298298
_ => println!("Could not parse file"),
299299
}
300300
}

0 commit comments

Comments
 (0)