Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/proc-macro-srv-cli/src/main.rs')
-rw-r--r--crates/proc-macro-srv-cli/src/main.rs21
1 files changed, 10 insertions, 11 deletions
diff --git a/crates/proc-macro-srv-cli/src/main.rs b/crates/proc-macro-srv-cli/src/main.rs
index 9d74fa637a..813ac339a9 100644
--- a/crates/proc-macro-srv-cli/src/main.rs
+++ b/crates/proc-macro-srv-cli/src/main.rs
@@ -31,7 +31,7 @@ fn main() -> std::io::Result<()> {
clap::Arg::new("format")
.long("format")
.action(clap::ArgAction::Set)
- .default_value("json")
+ .default_value("json-legacy")
.value_parser(clap::builder::EnumValueParser::<ProtocolFormat>::new()),
clap::Arg::new("version")
.long("version")
@@ -50,28 +50,27 @@ fn main() -> std::io::Result<()> {
#[derive(Copy, Clone)]
enum ProtocolFormat {
- Json,
- #[cfg(feature = "postcard")]
- Postcard,
+ JsonLegacy,
+ PostcardLegacy,
}
impl ValueEnum for ProtocolFormat {
fn value_variants<'a>() -> &'a [Self] {
- &[ProtocolFormat::Json]
+ &[ProtocolFormat::JsonLegacy, ProtocolFormat::PostcardLegacy]
}
fn to_possible_value(&self) -> Option<clap::builder::PossibleValue> {
match self {
- ProtocolFormat::Json => Some(clap::builder::PossibleValue::new("json")),
- #[cfg(feature = "postcard")]
- ProtocolFormat::Postcard => Some(clap::builder::PossibleValue::new("postcard")),
+ ProtocolFormat::JsonLegacy => Some(clap::builder::PossibleValue::new("json-legacy")),
+ ProtocolFormat::PostcardLegacy => {
+ Some(clap::builder::PossibleValue::new("postcard-legacy"))
+ }
}
}
fn from_str(input: &str, _ignore_case: bool) -> Result<Self, String> {
match input {
- "json" => Ok(ProtocolFormat::Json),
- #[cfg(feature = "postcard")]
- "postcard" => Ok(ProtocolFormat::Postcard),
+ "json-legacy" => Ok(ProtocolFormat::JsonLegacy),
+ "postcard-legacy" => Ok(ProtocolFormat::PostcardLegacy),
_ => Err(format!("unknown protocol format: {input}")),
}
}