-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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")] | ||
Check warning on line 7 in src/args.rs GitHub Actions / Check
Check warning on line 7 in src/args.rs GitHub Actions / Clippy Outputuse of deprecated function `<args::TargetLanguage as clap::ValueEnum>::to_possible_value::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[value(...)]`
|
||
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,19 +79,14 @@ impl BuildArgs { | |
} | ||
} | ||
|
||
impl ToString for TargetLanguage { | ||
fn to_string(&self) -> String { | ||
format!("{:?}", self) | ||
} | ||
} | ||
|
||
#[derive(Args, Debug)] | ||
pub struct InitArgs { | ||
#[arg(value_enum, short, long)] | ||
pub language: Option<TargetLanguage>, | ||
#[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 = "[email protected]")] | ||
#[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")] | ||
Check warning on line 123 in src/args.rs GitHub Actions / Check
Check warning on line 123 in src/args.rs GitHub Actions / Clippy Outputuse of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[command(...)]`
|
||
#[clap(author = "[email protected]")] | ||
Check warning on line 124 in src/args.rs GitHub Actions / Check
Check warning on line 124 in src/args.rs GitHub Actions / Clippy Outputuse of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[command(...)]`
|
||
#[clap(version = env!("CARGO_PKG_VERSION"))] | ||
Check warning on line 125 in src/args.rs GitHub Actions / Check
Check warning on line 125 in src/args.rs GitHub Actions / Clippy Outputuse of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[command(...)]`
|
||
#[clap(about = "Build system for the Lingua Franca coordination language", long_about = None)] | ||
Check warning on line 126 in src/args.rs GitHub Actions / Check
Check warning on line 126 in src/args.rs GitHub Actions / Clippy Outputuse of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[command(...)]`
|
||
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)] | ||
Check warning on line 137 in src/args.rs GitHub Actions / Check
Check warning on line 137 in src/args.rs GitHub Actions / Check
Check warning on line 137 in src/args.rs GitHub Actions / Clippy Outputuse of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::bare_action`: `#[arg(action)]` is now the default and is no longer needed`
Check warning on line 137 in src/args.rs GitHub Actions / Clippy Outputuse of deprecated function `<args::CommandLineArgs as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]`
|
||
pub verbose: bool, | ||
} |