summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Miąsko <tomasz.miasko@gmail.com>2019-02-03 00:00:00 +0000
committerTomasz Miąsko <tomasz.miasko@gmail.com>2019-02-04 00:27:06 +0100
commitfd0af5801de440d550725e1bac93497865cf21c4 (patch)
tree55f5b77c2cde79b72e312de4ec368e136da6c586
parent7ff7c513941cf389c59ee4dd102cf93cf2ea2a4a (diff)
downloaddconf-fd0af5801de440d550725e1bac93497865cf21c4.tar.gz
bin: Document update command directory argument
Document that update command takes optional directory argument, which allows to run update in an arbitrary directory instead of the default one. The functionality itself have been added earlier for testing purposes, but it is generally useful so lets document its existence. Closes #39. Based on a patch contributed by Takao Fujiwara.
-rw-r--r--bin/dconf.c16
-rw-r--r--docs/dconf-tool.xml2
2 files changed, 16 insertions, 2 deletions
diff --git a/bin/dconf.c b/bin/dconf.c
index 2688ca7..8e3f060 100644
--- a/bin/dconf.c
+++ b/bin/dconf.c
@@ -938,6 +938,12 @@ dconf_compile (const gchar **argv,
return gvdb_table_write_contents (table, output, byteswap, error);
}
+static gchar *
+get_system_db_path ()
+{
+ return g_build_filename (SYSCONFDIR, "dconf", "db", NULL);
+}
+
static gboolean
dconf_update (const gchar **argv,
GError **error)
@@ -951,7 +957,7 @@ dconf_update (const gchar **argv,
index += 1;
}
else
- dir = g_build_filename (SYSCONFDIR, "dconf", "db", NULL);
+ dir = get_system_db_path ();
if (argv[index] != NULL)
return option_error_set (error, "too many arguments");
@@ -1004,7 +1010,7 @@ static const Command commands[] = {
{
"update", dconf_update,
"Update the system dconf databases",
- ""
+ " [DBDIR] "
},
{
"watch", dconf_watch,
@@ -1116,6 +1122,12 @@ command_show_help (const Command *cmd,
if (strstr (cmd->synopsis, " SUFFIX ") != NULL)
g_string_append (s, " SUFFIX An empty string '' or '/'.\n");
+ if (strstr (cmd->synopsis, " [DBDIR] ") != NULL)
+ {
+ g_autofree gchar *path = get_system_db_path ();
+ g_string_append_printf (s, " DBDIR The databases directory. Default: %s\n", path);
+ }
+
g_string_append (s, "\n");
}
}
diff --git a/docs/dconf-tool.xml b/docs/dconf-tool.xml
index c606616..7093da6 100644
--- a/docs/dconf-tool.xml
+++ b/docs/dconf-tool.xml
@@ -33,6 +33,7 @@
<cmdsynopsis>
<command>dconf</command>
<arg choice="plain">read</arg>
+ <arg choice="opt">-d</arg>
<arg choice="plain"><replaceable>KEY</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
@@ -61,6 +62,7 @@
<cmdsynopsis>
<command>dconf</command>
<arg choice="plain">update</arg>
+ <arg choice="opt"><replaceable>DBDIR</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
<command>dconf</command>