From e41a408e2bdf2f7f1a3b91769ba6c47e48bb5595 Mon Sep 17 00:00:00 2001 From: Bart Polot Date: Thu, 18 Apr 2013 14:48:42 +0000 Subject: Add filename getopt operator --- src/util/getopt_helpers.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/util/getopt_helpers.c') diff --git a/src/util/getopt_helpers.c b/src/util/getopt_helpers.c index 5940c3ff9..f0f96d0d9 100644 --- a/src/util/getopt_helpers.c +++ b/src/util/getopt_helpers.c @@ -234,6 +234,18 @@ GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, } +int +GNUNET_GETOPT_set_filename (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, + void *scls, const char *option, const char *value) +{ + char **val = scls; + + GNUNET_assert (value != NULL); + GNUNET_free_non_null (*val); + *val = GNUNET_STRINGS_filename_expand (value); + return GNUNET_OK; +} + /** * Set an option of type 'unsigned long long' from the command line. * A pointer to this function should be passed as part of the -- cgit v1.2.3