aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/opendeco-cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/opendeco-cli.c')
-rw-r--r--src/opendeco-cli.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/opendeco-cli.c b/src/opendeco-cli.c
index e200fcd..8fb0ebd 100644
--- a/src/opendeco-cli.c
+++ b/src/opendeco-cli.c
@@ -60,10 +60,10 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
arguments->RMV_DIVE = arg ? atof(arg) : -1;
break;
case 'L':
- arguments->gflow = arg ? atoi(arg) : 100;
+ arguments->gflow = arg ? atoi(arg) : -1;
break;
case 'H':
- arguments->gfhigh = arg ? atoi(arg) : 100;
+ arguments->gfhigh = arg ? atoi(arg) : -1;
break;
case 'G':
if (arguments->decogasses)
@@ -93,6 +93,14 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
argp_failure(state, 1, 0, "Surface air pressure must be positive");
exit(ARGP_ERR_UNKNOWN);
}
+ if (arguments->gflow <= 0) {
+ argp_failure(state, 1, 0, "GF Low invalid");
+ exit(ARGP_ERR_UNKNOWN);
+ }
+ if (arguments->gfhigh <= 0) {
+ argp_failure(state, 1, 0, "GF High invalid");
+ exit(ARGP_ERR_UNKNOWN);
+ }
if (arguments->gflow > arguments->gfhigh) {
argp_failure(state, 1, 0, "GF Low must not be greater than GF High");
exit(ARGP_ERR_UNKNOWN);