-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
babefff
commit 00ebf4d
Showing
4 changed files
with
36 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,27 @@ | ||
# Examples | ||
|
||
This folder contains example scripts that can be used to interact with | ||
the `thor-devkit.rs` crate. | ||
the `thor-devkit` crate. | ||
|
||
## Quickstart | ||
|
||
[cargo-rx]: https://github.com/rnag/cargo-rx | ||
|
||
Install my crate [cargo-rx], which abstracts away `cargo run --example`. | ||
This provides a single `rx` command. | ||
Start out by cloning the GitHub project: | ||
|
||
```shell | ||
❯❯ cargo install cargo-rx | ||
``` | ||
|
||
Now start out by cloning the GitHub project: | ||
|
||
```shell | ||
❯❯ git clone https://github.com/sterliakov/thor-devkit.rs.git | ||
$ git clone https://github.com/sterliakov/thor-devkit.rs.git | ||
``` | ||
|
||
Then, simply `cd` into the project folder: | ||
|
||
```shell | ||
❯❯ cd thor-devkit.rs | ||
$ cd thor-devkit.rs | ||
``` | ||
|
||
From here, you can use `rx` to build and run | ||
From here, you can use `cargo run` to build and run | ||
any of the examples individually. | ||
|
||
In particular, here's a sample usage of running `examples/my_example.rs`: | ||
|
||
```shell | ||
❯❯ rx my_example | ||
``` | ||
|
||
If you run the command without any arguments, you can select | ||
from the list of available examples: | ||
|
||
```shell | ||
❯❯ rx | ||
``` | ||
|
||
To pass arguments to a script, you can include them after the `--`. | ||
|
||
For instance, here's an example of passing arguments to the `my_example` script: | ||
|
||
```shell | ||
❯❯ rx my_example -- \ | ||
-n "My Name" \ | ||
--my-arg 123 | ||
$ cargo run --example my_example | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters