summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-11-25 21:37:13 -0500
committerMatthias Clasen <mclasen@redhat.com>2015-11-25 21:38:20 -0500
commit978779044844f9ff793c10395443639cac964e31 (patch)
treed2b6a4012183aea8b0fdf8e62a3eb6988c1eb3ce
parentdb641e32920ee8b553ab6f2d318aafa156e4390c (diff)
downloadglib-978779044844f9ff793c10395443639cac964e31.tar.gz
GApplication: improve docs
Spell out which GVariant format strings to use for which commandline option types. I just wasted some time debugging this in an application.
-rw-r--r--gio/gapplication.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gio/gapplication.c b/gio/gapplication.c
index f45786562..98649b1c5 100644
--- a/gio/gapplication.c
+++ b/gio/gapplication.c
@@ -658,6 +658,17 @@ add_packed_option (GApplication *application,
* consumed, they will no longer be visible to the default handling
* (which treats them as filenames to be opened).
*
+ * It is important to use the proper GVariant format when retrieving
+ * the options with g_variant_dict_lookup():
+ * - for %G_OPTION_ARG_NONE, use b
+ * - for %G_OPTION_ARG_STRING, use &s
+ * - for %G_OPTION_ARG_INT, use i
+ * - for %G_OPTION_ARG_INT64, use x
+ * - for %G_OPTION_ARG_DOUBLE, use d
+ * - for %G_OPTION_ARG_FILENAME, use ^ay
+ * - for %G_OPTION_ARG_STRING_ARRAY, use &as
+ * - for %G_OPTION_ARG_FILENAME_ARRAY, use ^aay
+ *
* Since: 2.40
*/
void