@@ -45,22 +45,21 @@ pub struct Config<S>
4545where
4646 S : Clone + clap:: Args + StorageOpt ,
4747{
48- pub parseable : Opt < S > ,
48+ pub parseable : Server < S > ,
4949}
5050
5151impl < S > Config < S >
5252where
5353 S : Clone + clap:: Args + StorageOpt ,
5454{
5555 fn new ( ) -> Self {
56- let parseable = match Opt :: < S > :: try_parse ( ) {
56+ let Cli :: Server :: < S > ( args ) = match Cli :: < S > :: try_parse ( ) {
5757 Ok ( s) => s,
5858 Err ( e) => {
59- eprintln ! ( "You can also use the --demo flag to run Parseable with default object storage. For testing purposes only" ) ;
6059 e. exit ( ) ;
6160 }
6261 } ;
63- Config { parseable }
62+ Config { parseable : args }
6463 }
6564
6665 pub fn storage ( & self ) -> & S {
@@ -148,13 +147,23 @@ where
148147 }
149148}
150149
151- #[ derive( Debug , Clone , Parser ) ]
150+ #[ derive( Parser ) ] // requires `derive` feature
152151#[ command(
153152 name = "Parseable" ,
154- about = "Configuration for Parseable server" ,
153+ bin_name = "parseable" ,
154+ about = "Parseable is a log storage and observability platform." ,
155155 version
156156) ]
157- pub struct Opt < S >
157+ enum Cli < S >
158+ where
159+ S : Clone + clap:: Args + StorageOpt ,
160+ {
161+ Server ( Server < S > ) ,
162+ }
163+
164+ #[ derive( clap:: Args , Debug , Clone ) ]
165+ #[ clap( name = "server" , about = "Start the Parseable server" ) ]
166+ pub struct Server < S >
158167where
159168 S : Clone + clap:: Args + StorageOpt ,
160169{
@@ -222,7 +231,7 @@ where
222231 pub demo : bool ,
223232}
224233
225- impl < S > Opt < S >
234+ impl < S > Server < S >
226235where
227236 S : Clone + clap:: Args + StorageOpt ,
228237{
0 commit comments