diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-04-18 14:48:42 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-04-18 14:48:42 +0000 |
commit | e41a408e2bdf2f7f1a3b91769ba6c47e48bb5595 (patch) | |
tree | 8ba97dd04f2ad6ac18c570b839168fae20641620 /src/util/getopt_helpers.c | |
parent | 73703cf9e81d7a705aace4d030bab0befe0c0811 (diff) | |
download | gnunet-e41a408e2bdf2f7f1a3b91769ba6c47e48bb5595.tar.gz gnunet-e41a408e2bdf2f7f1a3b91769ba6c47e48bb5595.zip |
Add filename getopt operator
Diffstat (limited to 'src/util/getopt_helpers.c')
-rw-r--r-- | src/util/getopt_helpers.c | 12 |
1 files changed, 12 insertions, 0 deletions
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, | |||
234 | } | 234 | } |
235 | 235 | ||
236 | 236 | ||
237 | int | ||
238 | GNUNET_GETOPT_set_filename (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, | ||
239 | void *scls, const char *option, const char *value) | ||
240 | { | ||
241 | char **val = scls; | ||
242 | |||
243 | GNUNET_assert (value != NULL); | ||
244 | GNUNET_free_non_null (*val); | ||
245 | *val = GNUNET_STRINGS_filename_expand (value); | ||
246 | return GNUNET_OK; | ||
247 | } | ||
248 | |||
237 | /** | 249 | /** |
238 | * Set an option of type 'unsigned long long' from the command line. | 250 | * Set an option of type 'unsigned long long' from the command line. |
239 | * A pointer to this function should be passed as part of the | 251 | * A pointer to this function should be passed as part of the |