From 2653fe006379e75f7de1bc552717c1292377ded1 Mon Sep 17 00:00:00 2001 From: Sebastian Pastor Date: Thu, 8 Jun 2017 22:27:33 +0200 Subject: [PATCH] dey-examples: adc_cmp_sample: show_usage() to always output the long help Signed-off-by: Sebastian Pastor --- .../files/adc_cmp_sample/adc_cmp_sample.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c index 3e533ccb8..fa3e2073c 100644 --- a/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c +++ b/meta-digi-dey/recipes-digi/dey-examples/files/adc_cmp_sample/adc_cmp_sample.c @@ -27,10 +27,6 @@ #define BUFFER_LEN 20 -#define USAGE \ - "Usage:\n" \ - "adc_cmp_sample -c channel -l THRESH_LOW [options]\n\n" - #define FULL_USAGE \ "Usage:\n" \ "adc_cmp_sample -c channel [options]\n\n" \ @@ -50,9 +46,9 @@ typedef struct cmp { bool raw; } cmp_t; -static void show_usage(int full) +static void show_usage() { - fprintf(stdout, "%s", full ? FULL_USAGE : USAGE); + fprintf(stdout, "%s", FULL_USAGE); } static int read_adc_sample_sysfs(cmp_t *cmp, long int *val) @@ -340,7 +336,7 @@ int main(int argc, char **argv) struct iio_event_data event; if (argc <= 3) { - show_usage(0); + show_usage(); return EXIT_FAILURE; } @@ -377,10 +373,10 @@ int main(int argc, char **argv) cmp.raw = false; break; case '?': - show_usage(1); + show_usage(); return EXIT_SUCCESS; default: - show_usage(0); + show_usage(); return EXIT_FAILURE; } }