Skip to content

Commit

Permalink
Merge pull request #47 from lf-lang/fix/cli-interface-clean-up
Browse files Browse the repository at this point in the history
Target `type-script` renamed to `typescript`
  • Loading branch information
lhstrh authored Jan 29, 2024
2 parents d4ad592 + 67a1c2f commit faca130
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use serde_derive::{Deserialize, Serialize};
use std::path::PathBuf;

#[derive(clap::ValueEnum, Clone, Copy, Debug, Deserialize, Serialize, PartialEq)]
#[clap(rename_all = "lowercase")]
pub enum TargetLanguage {
C,
Cpp,
Expand Down Expand Up @@ -78,19 +79,14 @@ impl BuildArgs {
}
}

impl ToString for TargetLanguage {
fn to_string(&self) -> String {
format!("{:?}", self)
}
}

#[derive(Args, Debug)]
pub struct InitArgs {
#[clap(value_enum, short, long)]
pub language: Option<TargetLanguage>,
#[clap(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({
Expand Down Expand Up @@ -137,7 +133,7 @@ pub struct CommandLineArgs {
#[clap(short, long, action)]
pub quiet: bool,

/// lingo wouldn't produce any output
/// lingo will give more detailed feedback
#[clap(short, long, action)]
pub verbose: bool,
}

0 comments on commit faca130

Please sign in to comment.