Allow to customize glob and location in command question and hist, convert location type to enum.
This commit is contained in:
@@ -3,7 +3,7 @@ import argparse
|
||||
from pathlib import Path
|
||||
from ..configuration import Config
|
||||
from ..message import Message, MessageError
|
||||
from ..chat import ChatDB
|
||||
from ..chat import ChatDB, msg_location
|
||||
|
||||
|
||||
def print_message(message: Message, args: argparse.Namespace) -> None:
|
||||
@@ -38,7 +38,7 @@ def print_cmd(args: argparse.Namespace, config: Config) -> None:
|
||||
# print latest message
|
||||
elif args.latest:
|
||||
chat = ChatDB.from_dir(Path(config.cache), Path(config.db))
|
||||
latest = chat.msg_latest(loc='disk')
|
||||
latest = chat.msg_latest(loc=msg_location.DISK)
|
||||
if not latest:
|
||||
print("No message found!")
|
||||
sys.exit(1)
|
||||
|
||||
Reference in New Issue
Block a user