From bdc9ce543cb2a9bd6db9a14769860a5d21186e07 Mon Sep 17 00:00:00 2001 From: Lenka Segura Date: Jul 29 2019 19:49:37 +0000 Subject: Enforce required options Create and Merge commands have required options that should be properly reported to the users when they fail to pass them in. Signed-off-by: Lenka Segura --- diff --git a/cranc/commands/create.py b/cranc/commands/create.py index a2fcb75..9a18e89 100644 --- a/cranc/commands/create.py +++ b/cranc/commands/create.py @@ -15,11 +15,11 @@ def create(): @create.command(name="pr") -@click.option("--repo_to") -@click.option("--title") -@click.option("--branch_to") -@click.option("--branch_from") -@click.option("--repo_from") +@click.option("--repo_to", required=True) +@click.option("--title", required=True) +@click.option("--branch_to", required=True) +@click.option("--branch_from", required=True) +@click.option("--repo_from", required=True) @click.pass_context def create_pr(ctx, repo_to, title, branch_to, branch_from, repo_from): """this command creates a new pull request""" diff --git a/cranc/commands/merge.py b/cranc/commands/merge.py index acf0752..dabba01 100644 --- a/cranc/commands/merge.py +++ b/cranc/commands/merge.py @@ -16,7 +16,7 @@ def merge(): @merge.command(name="pr") -@click.option("--request_id") +@click.option("--request_id", required=True) @click.pass_context def merge_pr(ctx, request_id): """This command merges a pull request"""