@@ -31,7 +31,7 @@ fn main() -> std::io::Result<()> {
3131 clap:: Arg :: new ( "format" )
3232 . long ( "format" )
3333 . action ( clap:: ArgAction :: Set )
34- . default_value ( "json" )
34+ . default_value ( "json-legacy " )
3535 . value_parser ( clap:: builder:: EnumValueParser :: < ProtocolFormat > :: new ( ) ) ,
3636 clap:: Arg :: new ( "version" )
3737 . long ( "version" )
@@ -50,25 +50,27 @@ fn main() -> std::io::Result<()> {
5050
5151#[ derive( Copy , Clone ) ]
5252enum ProtocolFormat {
53- Json ,
54- Postcard ,
53+ JsonLegacy ,
54+ PostcardLegacy ,
5555}
5656
5757impl ValueEnum for ProtocolFormat {
5858 fn value_variants < ' a > ( ) -> & ' a [ Self ] {
59- & [ ProtocolFormat :: Json , ProtocolFormat :: Postcard ]
59+ & [ ProtocolFormat :: JsonLegacy , ProtocolFormat :: PostcardLegacy ]
6060 }
6161
6262 fn to_possible_value ( & self ) -> Option < clap:: builder:: PossibleValue > {
6363 match self {
64- ProtocolFormat :: Json => Some ( clap:: builder:: PossibleValue :: new ( "json" ) ) ,
65- ProtocolFormat :: Postcard => Some ( clap:: builder:: PossibleValue :: new ( "postcard" ) ) ,
64+ ProtocolFormat :: JsonLegacy => Some ( clap:: builder:: PossibleValue :: new ( "json-legacy" ) ) ,
65+ ProtocolFormat :: PostcardLegacy => {
66+ Some ( clap:: builder:: PossibleValue :: new ( "postcard-legacy" ) )
67+ }
6668 }
6769 }
6870 fn from_str ( input : & str , _ignore_case : bool ) -> Result < Self , String > {
6971 match input {
70- "json" => Ok ( ProtocolFormat :: Json ) ,
71- "postcard" => Ok ( ProtocolFormat :: Postcard ) ,
72+ "json-legacy " => Ok ( ProtocolFormat :: JsonLegacy ) ,
73+ "postcard-legacy " => Ok ( ProtocolFormat :: PostcardLegacy ) ,
7274 _ => Err ( format ! ( "unknown protocol format: {input}" ) ) ,
7375 }
7476 }
0 commit comments