Add --glob and --location flags to hist and question commands, to be able to specify the location and files they should use.

This commit is contained in:
Oleksandr Kozachuk
2023-10-19 16:03:51 +02:00
parent 9a493b57da
commit 114282dfd8
6 changed files with 29 additions and 5 deletions
+5 -2
View File
@@ -15,7 +15,8 @@ def convert_messages(args: argparse.Namespace, config: Config) -> None:
('.txt', '.yaml') to the latest default message file suffix ('.msg').
"""
chat = ChatDB.from_dir(Path(config.cache),
Path(config.db))
Path(config.db),
glob='*')
# read all known message files
msgs = chat.msg_gather(loc=msg_location.DISK, glob='*.*')
# make a set of all message IDs
@@ -55,7 +56,9 @@ def print_chat(args: argparse.Namespace, config: Config) -> None:
answer_contains=args.answer)
chat = ChatDB.from_dir(Path(config.cache),
Path(config.db),
mfilter=mfilter)
mfilter=mfilter,
loc=msg_location(args.location),
glob=args.glob)
chat.print(args.source_code_only,
args.with_metadata,
paged=not args.no_paging,