diff --git a/Cargo.toml b/Cargo.toml index e7c6436..6aa8f9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "lingua-franca" version = "0.2.0" edition = "2021" -description = "Packagemanager for Lingua-Franca" +description = "Package manager and build tool for the Lingua Franca coordination language" homepage = "https://lf-lang.org" repository = "https://github.com/lf-lang/lingo" license = "BSD-2-Clause" diff --git a/src/args.rs b/src/args.rs index f4553e4..e5ab5d3 100644 --- a/src/args.rs +++ b/src/args.rs @@ -3,7 +3,8 @@ use clap::{Args, Parser, Subcommand}; use serde_derive::{Deserialize, Serialize}; use std::path::PathBuf; -#[derive(clap::ValueEnum, Clone, Copy, Debug, Deserialize, Serialize, PartialEq, Hash, Eq)] +#[derive(clap::ValueEnum, Clone, Copy, Debug, Deserialize, Serialize, PartialEq, Hash)] +#[clap(rename_all = "lowercase")] pub enum TargetLanguage { C, Cpp, @@ -12,7 +13,7 @@ pub enum TargetLanguage { Python, } -#[derive(clap::ValueEnum, Clone, Copy, Debug, Deserialize, Serialize, PartialEq)] +#[derive(clap::ValueEnum, Clone, Copy, Debug, Deserialize, Serialize, PartialEq, Hash)] pub enum Platform { Native, Zephyr, @@ -78,12 +79,6 @@ impl BuildArgs { } } -impl ToString for TargetLanguage { - fn to_string(&self) -> String { - format!("{:?}", self) - } -} - #[derive(Args, Debug)] pub struct InitArgs { #[arg(value_enum, short, long)] @@ -91,6 +86,7 @@ pub struct InitArgs { #[arg(value_enum, short, long, default_value_t = Platform::Native)] pub platform: Platform, } + impl InitArgs { pub fn get_target_language(&self) -> TargetLanguage { self.language.unwrap_or({ @@ -124,10 +120,10 @@ pub enum Command { } #[derive(Parser)] -#[command(name = "lingua-franca package manager and build tool")] -#[command(author = "tassilo.tanneberger@tu-dresden.de")] -#[command(version = env!("CARGO_PKG_VERSION"))] -#[command(about = "Build system of lingua-franca projects", long_about = None)] +#[clap(name = "Lingua Franca package manager and build tool")] +#[clap(author = "tassilo.tanneberger@tu-dresden.de")] +#[clap(version = env!("CARGO_PKG_VERSION"))] +#[clap(about = "Build system for the Lingua Franca coordination language", long_about = None)] pub struct CommandLineArgs { /// which command of lingo to use #[clap(subcommand)] @@ -137,7 +133,7 @@ pub struct CommandLineArgs { #[arg(short, long)] pub quiet: bool, - /// lingo wouldn't produce any output - #[arg(short, long)] + /// lingo will give more detailed feedback + #[clap(short, long, action)] pub verbose: bool, }