Compare commits

..

3 Commits

Author SHA1 Message Date
2ffe2ac5f3 glossary: added '__post_init__' 2024-02-06 18:50:07 +01:00
a51c2ec2e0 added test module for the 'glossary' command 2024-02-06 18:50:07 +01:00
3c5b049b1f added 'glossary' command 2024-02-06 18:50:07 +01:00

View File

@ -9,7 +9,7 @@ class GlossaryCmdError(Exception):
pass
def get_glossary_file_path(name: str, config: Config) -> Path:
def get_glossary_file(name: str, config: Config) -> Path:
"""
Get the complete filename for a glossary with the given path.
"""
@ -48,7 +48,7 @@ def create_glossary(args: argparse.Namespace, config: Config) -> None:
print("Error: please specify the target language.")
sys.exit(1)
# create file or use the given one
glo_file = Path(args.file) if args.file else get_glossary_file_path(args.name, config)
glo_file = Path(args.file) if args.file else get_glossary_file(args.name, config)
if glo_file.exists():
print(f"Error: glossary '{glo_file}' already exists!")
sys.exit(1)