The following instructions will guide you to incrementing the Carlo language version number.
-
Open
carlotk/src/lib.rs
. Change theVERSION
string to the new version number. -
Open
carlotk/Cargo.toml
. Change the version number under the[package]
key. -
Open
Cargo.toml
and change both the package version (under[package]
) and thecarlotk
dependency version (under[dependencies.carlotk]
) to the new version number.
As a general rule, to minimize confusion and maximally facilitate dependency resolution, the Carlo binary and the CarloTK library must be at the same version.
The following instructions will guide you to adding a Carlo langauge subcommand.
-
Create a Cargo library package
carlo-sc
, wheresc
is your desired subcommand name. -
Add the following to your subcommand library's
Cargo.toml
file.
[dependencies.carlotk]
version = "0.12.0"
-
Create a function in your subcommand library named
sc
. It is recommended that you importcarlotk::prelude::*
so you can use the Carlo tokenizer, parser, and environment utilities. Your function must have the following signature:fn(CliArgs) -> ()
. -
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 usecarlotk::prelude::printhelp
, which has signaturefn(&str) -> !
. -
Create the following entry in
Cargo.toml
. Replacex.x.x
with the version number of your subcommand's crate.
[dependencies.sc]
package = "carlo-sc"
version = "x.x.x"
- In
src/main.rs
, addsubcommand sc
(on a new line) to theinclude_subcommands!
macro invocation.