Skip to content

Commit 9ed2a0d

Browse files
authored
print error when no input provided (#151)
1 parent 71b9fa3 commit 9ed2a0d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

csv2bufr/cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ def list_mappings(ctx):
8888
@click.option("--output", "output", help="File to save the template to")
8989
@cli_option_verbosity
9090
def create_mappings(ctx, sequence, output, verbosity):
91+
if not sequence:
92+
click.echo("Error: Please provide a BUFRsequence.", err=True)
93+
ctx.exit(1) # Exit with a non-zero status to indicate an error
94+
9195
msg = BUFRMessage(sequence)
9296
template = msg.create_template()
9397
if output:

0 commit comments

Comments
 (0)