Skip to content
Kavachकवच

The kavach Command: run

● Intermediate2 min

kavach run checks a program and runs it at once, like a script. Words after -- go to the program.

use std.cli

fn main() {
    const args = cli.args()
    if args.contains("--loud") {
        print("NAMASTE!")
    } else {
        print("Namaste")
    }
}
src/main.kav: Kavach code
terminal
kavach run
Namaste
kavach run -- --loud
NAMASTE!

kavach run hello.kav runs one file with no project at all. --native compiles it to machine code first, and --dry-run runs it without touching the outside world: see Dry runs.