diff --git a/pegleg/cli/commands.py b/pegleg/cli/commands.py index c7fceab0..a460d783 100644 --- a/pegleg/cli/commands.py +++ b/pegleg/cli/commands.py @@ -177,7 +177,7 @@ def show(*, save_location, site_name): @site.command('render', help='Render a site through the deckhand engine.') -@utils.SAVE_LOCATION_OPTION +@utils.SAVE_FILE_OPTION @click.option( '-v', '--validate', diff --git a/pegleg/cli/utils.py b/pegleg/cli/utils.py index ee712e5e..e1af0cde 100644 --- a/pegleg/cli/utils.py +++ b/pegleg/cli/utils.py @@ -95,9 +95,20 @@ SAVE_LOCATION_OPTION = click.option( '-o', # DEPRECATED '--output', # DEPRECATED 'save_location', + type=click.Path(writable=True), help='Where to save the output. Defaults to stdout. ' '-o (--output) is deprecated and will be removed.') +SAVE_FILE_OPTION = click.option( + '-s', + '--save-location', + '-o', # DEPRECATED + '--output', # DEPRECATED + 'save_location', + type=click.Path(dir_okay=False, file_okay=True, writable=True), + help='File to save the output. Defaults to stdout. ' + '-o (--output) is deprecated and will be removed.') + REPOSITORY_CLONE_PATH_OPTION = click.option( '-p', '--clone-path',