/* * lib/args.rs * * Copyright (C) 2024 Max Walters * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ use clap::{ Args as _Args, Parser, Subcommand }; #[derive(Parser)] #[command(name = "juicebox")] #[command(author = "Max Walters ")] #[command(version = "0.1.0")] #[command(about = "A simple, yet advanced programming language.", long_about = None)] pub struct Args { /// Set the file output name #[arg(short, long)] output: Option, #[command(subcommand)] command: Commands, /// The files to compile files: Option, } #[derive(Subcommand)] enum Commands { /// Starts the LSP LSP(LSP), /// Formats the specified Juicebox files Format(Format), } #[derive(_Args)] struct LSP { name: Option, } #[derive(_Args)] struct Format { files: String, }