Skip to main content

nash_cli/
cli.rs

1use clap::Parser;
2
3use crate::cmd;
4
5#[derive(Parser)]
6#[command(name = "nash", version, about = "The Nash programming language compiler", long_about = Some(crate::BANNER))]
7#[command(propagate_version = true)]
8pub struct Cli {
9    #[command(subcommand)]
10    pub cmd: cmd::Cmd,
11}
12
13impl Default for Cli {
14    fn default() -> Self {
15        Self::parse()
16    }
17}
18
19impl Cli {
20    pub async fn exec(self) -> miette::Result<()> {
21        self.cmd.exec().await
22    }
23}