use clap::{Args, Parser, Subcommand, ValueEnum}; use clap_complete::Shell; #[derive(Parser)] pub struct Cli { #[command(subcommand)] pub commands: Commands, } #[derive(Subcommand)] pub enum Commands { #[command(name = "bcf", about = "Build a configuration")] Test { host: Hosts }, #[command(name = "bpk", about = "Build a package")] BuildPkg { package: String }, #[command(name = "sh", about = "Enter a shell")] Shell { package: String }, #[command(name = "pkdef", about = "Show the definition of a package")] PackageDefinition { package: String }, #[command(name = "optdef", about = "Show the definition of a nixos module")] OptionDefinition { option: String }, #[command(name = "proj", about = "Project related commands")] Project(ProjectArgs), #[command(name = "compl", about = "Generate completions for a shell")] Completions { shell: Shell }, } #[derive(Args)] pub struct ProjectArgs { #[command(subcommand)] pub commands: ProjectCommands, } #[derive(Subcommand)] pub enum ProjectCommands { #[command( name = "init", about = "Initialize a rust project with npins and shell.nix" )] InitProject { project_name: String }, } #[derive(ValueEnum, Clone)] pub enum Hosts { #[value(name = "work")] Work, #[value(name = "vulpes")] Vulpes, #[value(name = "sand-archives")] SandArchives, }