Skip to content

Commit

Permalink
Fix rebasing conflicts
Browse files Browse the repository at this point in the history
Re add CSharp imports and update configuration and Args handling
  • Loading branch information
dandro committed Jan 23, 2025
1 parent 7e96efd commit d379501
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub enum AvailableLanguage {
Go,
#[cfg(feature = "python")]
Python,
CSharp,
}

#[derive(clap::Parser)]
Expand Down Expand Up @@ -49,6 +50,10 @@ pub struct Args {
#[arg(long)]
pub scala_package: Option<String>,

/// CSharp namespace
#[arg(long)]
pub csharp_namespace: Option<String>,

/// Scala serializer module name
#[arg(long)]
pub scala_module_name: Option<String>,
Expand Down
5 changes: 3 additions & 2 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use typeshare_core::language::Go;
use typeshare_core::language::Python;
use typeshare_core::{
context::ParseContext,
language::{CrateName, Kotlin, Language, Scala, SupportedLanguage, Swift, TypeScript},
language::{CSharp, CrateName, Kotlin, Language, Scala, SupportedLanguage, Swift, TypeScript},
parser::ParsedData,
reconcile::reconcile_aliases,
};
Expand Down Expand Up @@ -95,6 +95,7 @@ fn generate_types(config_file: Option<&Path>, options: &Args) -> anyhow::Result<
args::AvailableLanguage::Go => SupportedLanguage::Go,
#[cfg(feature = "python")]
args::AvailableLanguage::Python => SupportedLanguage::Python,
args::AvailableLanguage::CSharp => SupportedLanguage::CSharp,
},
};

Expand Down Expand Up @@ -268,7 +269,7 @@ fn override_configuration(mut config: Config, options: &Args) -> anyhow::Result<
config.scala.module_name = scala_module_name.to_string();
}

if let Some(csharp_namespace) = options.value_of(ARG_CSHARP_NAMESPACE) {
if let Some(csharp_namespace) = options.csharp_namespace.as_ref() {
config.csharp.namespace = csharp_namespace.to_string();
}

Expand Down

0 comments on commit d379501

Please sign in to comment.