Skip to content

Commit

Permalink
Update error handling to use Failure instead of Error-Chain, update d…
Browse files Browse the repository at this point in the history
…ocumentation, update dependencies
  • Loading branch information
djmcgill committed May 9, 2018
1 parent 2aa987d commit b03e902
Show file tree
Hide file tree
Showing 6 changed files with 252 additions and 107 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/target/
**/*.rs.bk
.idea/
*.iml
191 changes: 160 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ repository = "https://github.com/djmcgill/form"
[dependencies]
quote = "0.3"
getopts = "0.2"
log = "0.3.8"
env_logger = "0.4.3"
error-chain = "0.11.0"
log = "0.4.1"
env_logger = "0.5.1"
failure = "0.1.1"

[dependencies.syn]
version = "0.11.11"
Expand Down
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
# Form
![crates.io badge](https://img.shields.io/crates/v/form.svg)

A library for splitting apart a large file with multiple modules into the idiomatic rust directory structure, intended for use with svd2rust.
Creates a lib.rs as well as a subdirectory structure in the target directory.
It's advised (but not necessary) to use scalafmt afterwards.
Usage:
Creates a lib.rs as well as a subdirectory structure in the target directory. It does NOT create the cargo project or the cargo manifest file.

It's advised (but not necessary) to use rustfmt afterwards.
## Usage:
Arguments:
```
-i, --input FILE input file to read instead of stdin
-i, --input FILE OPTIONAL: input file to read, defaults to stdin
-o, --outdir DIR set output directory
-h, --help print this help menu
```

Does not create the cargo project or the cargo manifest file.

TODO:
- better error handling
Intended usage:
```bash
svd2rust -i FOO.svd | form -o ~/private/code/form/test/src
```

current usage:
RUST_LOG=form=debug RUST_BACKTRACE=1 cargo run --release -- -i ~/private/code/form/resources/full-lib.rs -f -o ~/private/code/form/test/src
Advanced usage:
```bash
cargo install form
export RUST_LOG=form=debug
export RUST_BACKTRACE=1
form -i ~/private/code/form/resources/full-lib.rs -o ~/private/code/form/test/src
```
Loading

0 comments on commit b03e902

Please sign in to comment.