Skip to content

Commit d7fb582

Browse files
committed
Update DEVELOPER_GUIDE.md with new subcommand info
1 parent 0cc318d commit d7fb582

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

DEVELOPER_GUIDE.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,25 @@ As a general rule, to minimize confusion and maximally facilitate dependency res
1717

1818
The following instructions will guide you to adding a Carlo langauge subcommand.
1919

20-
1. Create a Cargo library package in the `subcommands` directory with the name `sc`, where `sc` is your desired subcommand name. The package should have name `carlo-sc`.
20+
1. Create a Cargo library package `carlo-sc`, where `sc` is your desired subcommand name.
2121

22-
2. Add `carlotk` to your subcommand library's `Cargo.toml` file.
22+
2. Add the following to your subcommand library's `Cargo.toml` file.
23+
24+
```
25+
[dependencies.carlotk]
26+
version = "0.12.0"
27+
```
2328

2429
3. Create a function in your subcommand library named `sc`. It is recommended that you import `carlotk::prelude::*` so you can use the Carlo tokenizer, parser, and environment utilities. Your function must have the following signature: `fn(CliArgs) -> ()`.
2530

26-
4. Create the following entry in `Cargo.toml`.
31+
4. Create a function in your subcommand library named `helpme`. This function will print help information to the screen. Your function must have the following signature: `fn() -> !`. It is recommended you use `carlotk::prelude::printhelp`, which has signature `fn(&str) -> !`.
32+
33+
5. Create the following entry in `Cargo.toml`. Replace `x.x.x` with the version number of your subcommand's crate.
2734

2835
```
2936
[dependencies.sc]
30-
path = "./subcommands/sc"
37+
package = "carlo-sc"
38+
version = "x.x.x"
3139
```
3240

33-
5. In `src/main.rs`, add `subcommand sc` (on a new line) to the `include_subcommands!` macro invocation.
41+
6. In `src/main.rs`, add `subcommand sc` (on a new line) to the `include_subcommands!` macro invocation.

0 commit comments

Comments
 (0)