Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/jp_cli/src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub(crate) mod plugin;
mod query;
pub(crate) mod target;
pub(crate) mod time;
pub(crate) mod turn_range;
pub(crate) mod turn_selection;

use std::{fmt, num::NonZeroU8};

Expand Down
13 changes: 8 additions & 5 deletions crates/jp_cli/src/cmd/conversation/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ use crate::{
/// Pass `--confirm` to prompt for every conversation, or `--no-confirm` /
/// `--yes` to skip all prompts.
///
/// Use `--from`/`--until` to archive a range of conversations by creation date,
/// or `--inactive-since` to archive everything unused since a given time.
/// Use `--created-since`/`--created-before` to archive a range of conversations
/// by creation date, or `--inactive-since` to archive everything unused since a
/// given time.
/// The three filters AND together when combined.
///
/// Archived conversations are hidden from listings and pickers.
Expand All @@ -37,15 +38,17 @@ pub(crate) struct Archive {
#[command(flatten)]
target: PositionalIds<false, true>,

/// Archive all conversations created in a `[--from, --until)` range.
/// Archive all conversations created in a `[--created-since,
/// --created-before)` range.
#[command(flatten)]
range: CreationRange,

/// Archive all conversations inactive since a given time.
///
/// Accepts the same formats as `--from`.
/// Accepts the same formats as `--created-since`.
/// Filters on `last_activated_at` (when the conversation was last used)
/// rather than its creation date, which makes this distinct from `--until`.
/// rather than its creation date, which makes this distinct from the
/// `--created-since`/`--created-before` range.
#[arg(long, conflicts_with = "id")]
inactive_since: Option<TimeThreshold>,

Expand Down
16 changes: 8 additions & 8 deletions crates/jp_cli/src/cmd/conversation/archive_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ fn inactive_since_returns_no_load_request() {
fn from_returns_no_load_request() {
let cmd = Archive {
range: CreationRange {
from: Some("1d".parse().unwrap()),
until: None,
since: Some("1d".parse().unwrap()),
before: None,
},
..empty_archive()
};
Expand All @@ -131,8 +131,8 @@ fn from_returns_no_load_request() {
fn until_returns_no_load_request() {
let cmd = Archive {
range: CreationRange {
from: None,
until: Some("1d".parse().unwrap()),
since: None,
before: Some("1d".parse().unwrap()),
},
..empty_archive()
};
Expand Down Expand Up @@ -168,8 +168,8 @@ fn matches_inactive_since_uses_last_activated_at() {
fn matches_filters_and_compose() {
let cmd = Archive {
range: CreationRange {
from: Some(ts(1000).into()),
until: Some(ts(2000).into()),
since: Some(ts(1000).into()),
before: Some(ts(2000).into()),
},
inactive_since: Some(ts(5000).into()),
..empty_archive()
Expand Down Expand Up @@ -234,8 +234,8 @@ fn resolve_filtered_composes_range_and_inactive_since() {

let cmd = Archive {
range: CreationRange {
from: Some(ts(1000).into()),
until: Some(ts(2000).into()),
since: Some(ts(1000).into()),
before: Some(ts(2000).into()),
},
inactive_since: Some(ts(5000).into()),
..empty_archive()
Expand Down
Loading
Loading