diff --git a/src/jcloud_docsgen/cli.py b/src/jcloud_docsgen/cli.py index 0c0596e..0189116 100644 --- a/src/jcloud_docsgen/cli.py +++ b/src/jcloud_docsgen/cli.py @@ -30,9 +30,15 @@ def existing_directory(path: str) -> pathlib.Path: raise argparse.ArgumentTypeError(f'{_path}: no such file or directory') if not path.is_dir(): raise argparse.ArgumentTypeError(f'{_path}: not a directory') + return path def main() -> int: argument_parser = argparse.ArgumentParser() argument_parser.add_argument('project_directory', type = existing_directory, nargs = '?', default = pathlib.Path('.'), help = 'The directory of the project') + argument_parser.add_argument('-o', '--output-dir', type = pathlib.Path, help = 'the output directory the documentation will be written to') args = argument_parser.parse_args() + + if args.output_dir is None: + args.output_dir = args.project_directory / 'docs/reference' + return 0