summaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorNicolas Schodet2019-11-16 18:01:12 +0100
committerNicolas Schodet2019-11-16 18:01:12 +0100
commit76389b999910e3aa3900d5a611588f4a5983e224 (patch)
tree00ab410f916aaa31a997a8812983a78a9f1f6c2d /options.c
parent9df5e32b72dee3e4973f00b3048835d58e1550fb (diff)
Add back raw output
Diffstat (limited to 'options.c')
-rw-r--r--options.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/options.c b/options.c
index bd9f82b..c8baaa2 100644
--- a/options.c
+++ b/options.c
@@ -40,11 +40,13 @@ options_add(GApplication *app)
G_OPTION_ARG_DOUBLE, "exposure value", "MS");
g_application_add_main_option(app, "gain", 'g', 0,
G_OPTION_ARG_DOUBLE, "gain value", "VALUE");
+ g_application_add_main_option(app, "count", 'n', 0,
+ G_OPTION_ARG_INT, "number of image to take", "N");
+ g_application_add_main_option(app, "raw", 'r', 0,
+ G_OPTION_ARG_NONE, "do not convert image", NULL);
g_application_add_main_option(app, "output", 'o', 0,
G_OPTION_ARG_FILENAME,
"output file pattern (default: out%02d.png)", "PATTERN");
- g_application_add_main_option(app, "count", 'n', 0,
- G_OPTION_ARG_INT, "number of image to take", "N");
}
gint
@@ -56,6 +58,7 @@ options_handle(GApplication *app, GVariantDict *options_dict)
options.exposure_ms = -1.0;
options.gain = -1.0;
options.count = 1;
+ options.raw = false;
options.out = NULL;
bool option_set = false;
if (g_variant_dict_lookup(options_dict, "width", "i", &options.width)) {
@@ -79,6 +82,10 @@ options_handle(GApplication *app, GVariantDict *options_dict)
if (options.count <= 0)
utils_fatal("invalid count");
}
+ if (g_variant_dict_contains(options_dict, "raw")) {
+ option_set = true;
+ options.raw = true;
+ }
if (g_variant_dict_lookup(options_dict, "out", "^&ay", &options.out)) {
option_set = true;
int argtypes[1];