feat(cli): add path & limit to session list command (#4878)
This commit is contained in:
@@ -98,9 +98,6 @@ fn parse_key_val(s: &str) -> Result<(String, String), String> {
|
||||
enum SessionCommand {
|
||||
#[command(about = "List all available sessions")]
|
||||
List {
|
||||
#[arg(short, long, help = "List all available sessions")]
|
||||
verbose: bool,
|
||||
|
||||
#[arg(
|
||||
short,
|
||||
long,
|
||||
@@ -115,6 +112,16 @@ enum SessionCommand {
|
||||
long_help = "Sort sessions by date in ascending order (oldest first). Default is descending order (newest first)."
|
||||
)]
|
||||
ascending: bool,
|
||||
|
||||
#[arg(
|
||||
short = 'p',
|
||||
long = "working_dir",
|
||||
help = "Filter sessions by working directory"
|
||||
)]
|
||||
working_dir: Option<PathBuf>,
|
||||
|
||||
#[arg(short = 'l', long = "limit", help = "Limit the number of results")]
|
||||
limit: Option<usize>,
|
||||
},
|
||||
#[command(about = "Remove sessions. Runs interactively if no ID or regex is provided.")]
|
||||
Remove {
|
||||
@@ -182,11 +189,9 @@ enum SchedulerCommand {
|
||||
/// ID of the schedule
|
||||
#[arg(long, help = "ID of the schedule")] // Explicitly make it --id
|
||||
id: String,
|
||||
/// Maximum number of sessions to return
|
||||
#[arg(long, help = "Maximum number of sessions to return")]
|
||||
limit: Option<u32>,
|
||||
limit: Option<usize>,
|
||||
},
|
||||
/// Run a scheduled job immediately
|
||||
#[command(about = "Run a scheduled job immediately")]
|
||||
RunNow {
|
||||
/// ID of the schedule to run
|
||||
@@ -795,11 +800,12 @@ pub async fn cli() -> Result<()> {
|
||||
}) => {
|
||||
return match command {
|
||||
Some(SessionCommand::List {
|
||||
verbose,
|
||||
format,
|
||||
ascending,
|
||||
working_dir,
|
||||
limit,
|
||||
}) => {
|
||||
handle_session_list(verbose, format, ascending).await?;
|
||||
handle_session_list(format, ascending, working_dir, limit).await?;
|
||||
Ok(())
|
||||
}
|
||||
Some(SessionCommand::Remove { id, regex }) => {
|
||||
|
||||
Reference in New Issue
Block a user