egghead
Search
Search
Log In
Search
Search
Creating a Digital Garden CLI with Rust by Chris Biscardi
README-driven planning for a Digital Garden CLI in Rust
Initialize a new Cargo binary crate in a new package
Rename the default Cargo binary to be different than the package name
Using the todo macro to typecheck unwritten code that will be implemented in the future
Using color_eyre and distributed tracing to yield better error messages to the user
Setting up git-like subcommands using structopt
Documenting and writing helptext for Structopt CLI commands and flags
Integration testing Cargo binaries with assert_cmd
Matching structopt commands and using Rust values after move
Creating a library crate to support a Rust binary crate in the same package
Adding support for global flags that apply for all subcommands with structopt
Passing control to the user's favorite editor (such as VSCode) from the CLI
Using the Option type in Rust to pick from multiple values that might not exist
Prompting the user for input with rprompt and loop
Checking for file existence with PathBuf to ensure unique filenames
Using owo_colors Extension Traits to colorize terminal output
Using assert_fs and predicates to integration test with a real temporary file system
Abstracting test utilities inside integration test files
egghead
System