fixed 'tag' and 'hist' commands
This commit is contained in:
@@ -67,7 +67,7 @@ def tag_cmd(args: argparse.Namespace, config: dict) -> None:
|
||||
Handler for the 'tag' command.
|
||||
"""
|
||||
if args.list:
|
||||
print_tags_frequency(get_tags(config, None), args.dump)
|
||||
print_tags_frequency(get_tags(config, None))
|
||||
|
||||
|
||||
def model_cmd(args: argparse.Namespace, config: dict) -> None:
|
||||
@@ -115,14 +115,14 @@ def print_cmd(args: argparse.Namespace, config: dict) -> None:
|
||||
"""
|
||||
Handler for the 'print' command.
|
||||
"""
|
||||
fname = pathlib.Path(args.print)
|
||||
fname = pathlib.Path(args.file)
|
||||
if fname.suffix == '.yaml':
|
||||
with open(args.print, 'r') as f:
|
||||
with open(args.file, 'r') as f:
|
||||
data = yaml.load(f, Loader=yaml.FullLoader)
|
||||
elif fname.suffix == '.txt':
|
||||
data = read_file(fname)
|
||||
else:
|
||||
print(f"Unknown file type: {args.print}")
|
||||
print(f"Unknown file type: {args.file}")
|
||||
sys.exit(1)
|
||||
if args.only_source_code:
|
||||
display_source_code(data['answer'])
|
||||
|
||||
Reference in New Issue
Block a user