Skip to main content

parse_args

Function parse_args 

Source
pub fn parse_args() -> Result<Option<Command>>
Expand description

Parse CLI arguments from std::env::args().

Returns None if the first argument is not a known subcommand. Customize: extend this to use clap or another arg parser for a real CLI. This is intentionally minimal so Soma compiles without extra deps.

ยงCUSTOMIZE: Adding a new subcommand

  1. Add a variant to Command above.
  2. Add a match arm here to construct it from args.
  3. Add a dispatch arm in run() below.
  4. Update USAGE above.