File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -90,11 +90,13 @@ def yield_account_id_and_message_ids(
9090@click .option ("--only-account-id" , type = int , default = None )
9191@click .option ("--only-inbox" , is_flag = True , default = False )
9292@click .option ("--only-types" , default = "," .join (ALL_ACCOUNT_TYPES ))
93+ @click .option ("--only-categories" , default = None )
9394@click .option ("--dry-run/--no-dry-run" , default = True )
9495def main (
9596 only_account_id : int | None ,
9697 only_inbox : bool ,
9798 only_types : str ,
99+ only_categories : str | None ,
98100 date_start : datetime .date | None ,
99101 date_end : datetime .date | None ,
100102 dry_run : bool ,
@@ -137,6 +139,11 @@ def session_factory():
137139 category .name for category in message .categories if category .name
138140 )
139141 if old_categories != new_categories :
142+ if only_categories and not new_categories & only_categories .split (
143+ ","
144+ ):
145+ continue
146+
140147 changed_counter += 1
141148 print (
142149 f"\t { message .id = } , { message .message_id_header = } , { old_categories = } to { new_categories = } "
You can’t perform that action at this time.
0 commit comments