Skip to content
This repository was archived by the owner on Jan 2, 2026. It is now read-only.

Commit db0036c

Browse files
committed
chore(docs): Add missing docs
1 parent eccf6ce commit db0036c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cli/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ use clap::Parser;
99

1010
use crate::StdResult;
1111

12+
/// Module-local global for storing CLI arg values after they have been parsed.
1213
static CLI_ARGUMENTS: OnceLock<Args> = OnceLock::new();
1314

1415
#[derive(Debug, clap::Parser)]
1516
#[command(name = "sonata")]
1617
#[command(version, long_about = None)]
18+
/// `sonata` CLI args
1719
pub struct Args {
1820
#[arg(short, long, value_name = "FILE")]
1921
/// Path to a sonata config.toml file. If not specified, will use default values.
@@ -35,6 +37,8 @@ pub struct Args {
3537

3638
impl Args {
3739
#[cfg_attr(coverage_nightly, coverage(off))]
40+
/// Initialize the global Args storage by parsing the CLI arguments, then keeping them in memory.
41+
/// Will only yield `Err` after the first call.
3842
pub fn init_global() -> StdResult<&'static Self> {
3943
let parsed = Args::try_parse()?;
4044
CLI_ARGUMENTS.set(parsed).map_err(|_| String::from("cli arguments already parsed"))?;

0 commit comments

Comments
 (0)