File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,16 @@ fn validate_max_rows(s: &str) -> Result<usize> {
2424 }
2525}
2626
27+ /// Validate that poll-interval is a positive integer (> 0)
28+ fn validate_poll_interval ( s : & str ) -> Result < u64 > {
29+ let value = s. parse ( ) ?;
30+ if value > 0 {
31+ Ok ( value)
32+ } else {
33+ Err ( anyhow:: anyhow!( "poll-interval must be a positive integer" ) )
34+ }
35+ }
36+
2737/// Check if a project identifier is numeric (project ID) or string (project slug)
2838fn is_numeric_project_id ( project : & str ) -> bool {
2939 !project. is_empty ( ) && project. chars ( ) . all ( |c| c. is_ascii_digit ( ) )
@@ -63,7 +73,8 @@ pub(super) struct ListLogsArgs {
6373 live : bool ,
6474
6575 #[ arg( long = "poll-interval" , default_value = "2" ) ]
66- #[ arg( help = "Poll interval in seconds. Only used when --live is specified." ) ]
76+ #[ arg( value_parser = validate_poll_interval) ]
77+ #[ arg( help = "Poll interval in seconds (must be > 0). Only used when --live is specified." ) ]
6778 poll_interval : u64 ,
6879}
6980
You can’t perform that action at this time.
0 commit comments