@@ -71,14 +71,14 @@ enum Commands {
7171 ) ]
7272 detect_subprocesses : bool ,
7373 #[ clap(
74+ arg_enum,
7475 name = "log_level" ,
7576 short,
7677 long = "log-level" ,
7778 value_name = "LOG_LEVEL" ,
78- help = "" ,
79- default_value = "info"
79+ help = "[default: info] log level for the application"
8080 ) ]
81- log_level : LogLevel ,
81+ log_level : Option < LogLevel > ,
8282 #[ clap(
8383 name = "no_logging" ,
8484 long = "no-logging" ,
@@ -112,26 +112,26 @@ enum Commands {
112112 name = "sample_rate" ,
113113 long = "sample-rate" ,
114114 value_name = "SAMPLE_RATE" ,
115- help = "sample rate for the profiler in Hz. 100 means reading 100 times per second" ,
116- default_value = "100"
115+ help = "[default: 100] sample rate for the profiler in Hz. 100 means reading 100 times per second"
117116 ) ]
118- sample_rate : i32 ,
117+ sample_rate : Option < u32 > ,
119118 #[ clap(
120119 name = "server_address" ,
121120 long = "server-address" ,
122121 value_name = "SERVER_ADDRESS" ,
123- help = "Pyroscope server address" ,
124- default_value = "http://localhost:4040"
122+ help = "[default: http://localhost:4040] Pyroscope server address"
125123 ) ]
126- server_address : String ,
124+ server_address : Option < String > ,
127125 #[ clap(
126+ arg_enum,
128127 name = "spy_name" ,
129128 long = "spy-name" ,
130129 value_name = "SPY_NAME" ,
131130 help = "name of the profiler to use"
132131 ) ]
133132 spy_name : Spy ,
134133 #[ clap(
134+ multiple = true ,
135135 name = "tag" ,
136136 long = "tag" ,
137137 value_name = "TAG" ,
@@ -180,7 +180,7 @@ enum Commands {
180180 //value_name = "AUTH_TOKEN",
181181 //help = "authorization token used to upload profiling data"
182182 //)]
183- auth_token : Option < String > ,
183+ // auth_token: Option<String>,
184184 #[ clap(
185185 name = "detect_subprocesses" ,
186186 long = "detect-subprocesses" ,
@@ -189,35 +189,28 @@ enum Commands {
189189 ) ]
190190 detect_subprocesses : bool ,
191191 #[ clap(
192- name = "group_name" ,
193- long = "group-name" ,
194- value_name = "GROUP_NAME" ,
195- help = "start process under specified group name"
196- ) ]
197- group_name : Option < String > ,
198- #[ clap(
192+ arg_enum,
199193 name = "log_level" ,
200194 short,
201195 long = "log-level" ,
202196 value_name = "LOG_LEVEL" ,
203- help = "" ,
204- default_value = "info"
197+ help = "[default: info] log level for the application"
205198 ) ]
206- log_level : LogLevel ,
199+ log_level : Option < LogLevel > ,
207200 #[ clap(
208201 name = "no_logging" ,
209202 long = "no-logging" ,
210203 value_name = "NO_LOGGING" ,
211204 help = "disable logging from pyroscope"
212205 ) ]
213206 no_logging : bool ,
214- #[ clap(
215- name = "no_root_drop" ,
216- long = "no-root-drop" ,
217- value_name = "NO_ROOT_DROP" ,
218- help = "disable permissions drop when ran under root. use this one if you want to run your command as root"
219- ) ]
220- no_root_drop : bool ,
207+ // #[clap(
208+ // name = "no_root_drop",
209+ // long = "no-root-drop",
210+ // value_name = "NO_ROOT_DROP",
211+ // help = "disable permissions drop when ran under root. use this one if you want to run your command as root"
212+ // )]
213+ // no_root_drop: bool,
221214 #[ clap(
222215 name = "pyspy_blocking" ,
223216 long = "pyspy-blocking" ,
@@ -236,19 +229,18 @@ enum Commands {
236229 name = "sample_rate" ,
237230 long = "sample-rate" ,
238231 value_name = "SAMPLE_RATE" ,
239- help = "sample rate for the profiler in Hz. 100 means reading 100 times per second" ,
240- default_value = "100"
232+ help = "[default: 100] sample rate for the profiler in Hz. 100 means reading 100 times per second"
241233 ) ]
242- sample_rate : u32 ,
234+ sample_rate : Option < u32 > ,
243235 #[ clap(
244236 name = "server_address" ,
245237 long = "server-address" ,
246238 value_name = "SERVER_ADDRESS" ,
247- help = "Pyroscope server address" ,
248- default_value = "http://localhost:4040"
239+ help = "[default: http://localhost:4040] Pyroscope server address"
249240 ) ]
250- server_address : String ,
241+ server_address : Option < String > ,
251242 #[ clap(
243+ arg_enum,
252244 name = "spy_name" ,
253245 long = "spy-name" ,
254246 value_name = "SPY_NAME" ,
@@ -287,6 +279,13 @@ enum Commands {
287279 help = "start process under specified user name"
288280 ) ]
289281 user_name : Option < String > ,
282+ #[ clap(
283+ name = "group_name" ,
284+ long = "group-name" ,
285+ value_name = "GROUP_NAME" ,
286+ help = "start process under specified group name"
287+ ) ]
288+ group_name : Option < String > ,
290289 } ,
291290 #[ clap(
292291 name = "config" ,
@@ -318,10 +317,11 @@ pub fn cli_match() -> Result<()> {
318317 AppConfig :: merge_config ( cli. config . as_deref ( ) ) ?;
319318
320319 let app = Cli :: into_app ( ) ;
320+
321+ // Merge clap args into config
321322 AppConfig :: merge_args ( app) ?;
322323
323324 let mut app = Cli :: into_app ( ) ;
324-
325325 // Execute the subcommand
326326 match & cli. command {
327327 Commands :: Exec { .. } => {
0 commit comments