Skip to content

julesdelarue/rust-cli-workshop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust

screenshot

Learn Rust by building Command Line Application

Repository used for workshop

🎯 What we will build

🦀 Crabby command line !

$ crabby --help

crabby 0.1.0
I am the crabby help usage.

USAGE:
    crabby <SUBCOMMAND>

OPTIONS:
    -h, --help       Print help information
    -V, --version    Print version information

SUBCOMMANDS:
    chifoumi    chifoumi with players
    greets      Greets with name
    help        Print this message or the help of the given subcommand(s)

📝 Requirements

You'll need to install:

TLDR;

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

⚠️ Note on Windows

Rust requires certain C++ build tools. You can either download the Microsoft C++ Build Tools, or (recommended) you might prefer just to install Microsoft Visual Studio.

More about Installation setup on windows

Verify your toolchain version

Minimum Version : 1.66+ (tested)

rustc --version
rustc 1.66.0 (69f9c33d7 2022-12-12)

Keep your rust up-to-date with the latest release of rust, type:

rustup update

Choose your IDE

More tools on Rust website

Alternative to IDE

When your computer is annoying or you are not admin...

📝 Workshop instructions

👀 Solutions

❗ Try your solution first. Errors help to learn with Rust

Each part have a working solution

// inside each directory 
cd <partx>/solutions
cargo run 

Run solutions :

// from git root directory
cargo run --bin crabby_setup
cargo run --bin crabby_syntax
cargo run --bin crabby_args
cargo run --bin crabby_cli

bin name is defined in related <partx>/solutions/Cargo.toml files

⚡ Tests

You are not required to write test during workshop but it always a good pratice so have a look !

// all
cargo test

//specific
cargo test --bin crabby_setup
cargo test --bin crabby_syntax
cargo test --bin crabby_args
cargo test --bin crabby_mod
cargo test --bin crabby_cli

📚 Additional resources

About

Workshop to learn and practice Rust (ongoing)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%