[glib: 1/2] goption: Slightly improve the documentation for G_OPTION_FLAG_REVERSE
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/2] goption: Slightly improve the documentation for G_OPTION_FLAG_REVERSE
- Date: Sat, 23 Jul 2022 17:39:30 +0000 (UTC)
commit 8b1e8ecb54f80a760bdc694f7494fed4c0bc2675
Author: Philip Withnall <pwithnall endlessos org>
Date: Wed Jul 13 15:58:24 2022 +0100
goption: Slightly improve the documentation for G_OPTION_FLAG_REVERSE
None of the documentation actually mentioned booleans, which would be a
useful keyword to include for context.
Inspired by https://stackoverflow.com/questions/72958500/what-is-the-sense-of-a-command-line-option
Signed-off-by: Philip Withnall <pwithnall endlessos org>
glib/goption.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/glib/goption.h b/glib/goption.h
index 3d525a5484..6d7de3ae5f 100644
--- a/glib/goption.h
+++ b/glib/goption.h
@@ -60,7 +60,8 @@ typedef struct _GOptionEntry GOptionEntry;
* @G_OPTION_FLAG_IN_MAIN: The option appears in the main section of the
* `--help` output, even if it is defined in a group.
* @G_OPTION_FLAG_REVERSE: For options of the %G_OPTION_ARG_NONE kind, this
- * flag indicates that the sense of the option is reversed.
+ * flag indicates that the sense of the option is reversed. i.e. %FALSE will
+ * be stored into the argument rather than %TRUE.
* @G_OPTION_FLAG_NO_ARG: For options of the %G_OPTION_ARG_CALLBACK kind,
* this flag indicates that the callback does not take any argument
* (like a %G_OPTION_ARG_NONE option). Since 2.8
@@ -94,7 +95,7 @@ typedef enum
/**
* GOptionArg:
- * @G_OPTION_ARG_NONE: No extra argument. This is useful for simple flags.
+ * @G_OPTION_ARG_NONE: No extra argument. This is useful for simple flags or booleans.
* @G_OPTION_ARG_STRING: The option takes a UTF-8 string argument.
* @G_OPTION_ARG_INT: The option takes an integer argument.
* @G_OPTION_ARG_CALLBACK: The option provides a callback (of type
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]