File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ pub struct OptFilters {
51
51
pub limit : Option < i64 > ,
52
52
pub offset : Option < i64 > ,
53
53
pub reverse : bool ,
54
+ pub include_duplicates : bool ,
54
55
}
55
56
56
57
pub fn current_context ( ) -> Context {
@@ -410,7 +411,9 @@ impl Database for Sqlite {
410
411
) -> Result < Vec < History > > {
411
412
let mut sql = SqlBuilder :: select_from ( "history" ) ;
412
413
413
- sql. group_by ( "command" ) . having ( "max(timestamp)" ) ;
414
+ if !filter_options. include_duplicates {
415
+ sql. group_by ( "command" ) . having ( "max(timestamp)" ) ;
416
+ }
414
417
415
418
if let Some ( limit) = filter_options. limit {
416
419
sql. limit ( limit) ;
Original file line number Diff line number Diff line change @@ -123,6 +123,10 @@ pub struct Cmd {
123
123
/// Set the maximum number of lines Atuin's interface should take up.
124
124
#[ arg( long = "inline-height" ) ]
125
125
inline_height : Option < u16 > ,
126
+
127
+ /// Include duplicate commands in the output (non-interactive only)
128
+ #[ arg( long) ]
129
+ include_duplicates : bool ,
126
130
}
127
131
128
132
impl Cmd {
@@ -221,6 +225,7 @@ impl Cmd {
221
225
limit : self . limit ,
222
226
offset : self . offset ,
223
227
reverse : self . reverse ,
228
+ include_duplicates : self . include_duplicates ,
224
229
} ;
225
230
226
231
let mut entries =
You can’t perform that action at this time.
0 commit comments