Skip to main content

nash_cli/cmd/
mod.rs

1pub mod check;
2pub mod lsp;
3
4#[derive(clap::Subcommand)]
5pub enum Cmd {
6    /// Check a Nash project for errors
7    #[clap(visible_alias = "c")]
8    Check(check::Args),
9    /// Start the Nash language server over stdio
10    Lsp(lsp::Args),
11}
12
13impl Cmd {
14    pub async fn exec(self) -> miette::Result<()> {
15        match self {
16            Cmd::Check(args) => args.exec().await,
17            Cmd::Lsp(args) => lsp::exec(args).await,
18        }
19    }
20}