making the CLI interface much nicer with clap

This commit is contained in:
Henrik Böving
2021-03-05 20:51:54 +01:00
parent 11635c8495
commit 5d51f1af5b
4 changed files with 142 additions and 34 deletions

View File

@@ -5,7 +5,7 @@ A CLI frontend for `hm-asm-simulate`, it provides two commands:
## Generate
You can generate the data and program memory for a program like this
```
$ cargo run -- generate examples/add_endless.asm
$ cargo run -- compile ../examples/add_endless.asm
Data Memory:
0 1 1 0
0 0 0 0
@@ -22,7 +22,7 @@ And that's your program!
## Simulate
Alternatively you can simulate an asm program for n clock cycles like this:
```
$ cargo run -- simulate examples/add_endless.asm 4
$ cargo run -- simulate ../examples/add_endless.asm 4
```
It is going to proceed and print an HTML table of all states since the only purpose of this tool is to avoid using
mahara as an in browser lab book -> we just autogenerate the tables.