sveltecli/
opts.rs

1use clap::{Args, Parser, Subcommand};
2use std::path::PathBuf;
3
4#[derive(Subcommand, Debug)]
5pub enum Action {
6    Add(Add),
7    Config(Config),
8    Print,
9}
10
11#[derive(Parser, Debug)]
12#[command(author, version)]
13#[command(
14    about = "Svelte CLI",
15    long_about = "Svelte CLI is a command line interface for Svelte prototyping and development."
16)]
17pub struct Opts {
18    #[command(subcommand)]
19    pub action: Action,
20}
21
22#[derive(Args, Debug)]
23pub struct Add {
24    pub args: Vec<String>,
25
26    #[arg(short = 'p', long = "pwd")]
27    pub pwd: Option<PathBuf>,
28}
29
30#[derive(Args, Debug)]
31pub struct Config {
32    pub key: String,
33
34    pub value: String,
35}