summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAllison Ryan Lortie <desrt@desrt.ca>2015-11-30 14:45:29 -0500
committerAllison Ryan Lortie <desrt@desrt.ca>2015-11-30 14:59:10 -0500
commite7705f6d999486b0c840bedf97f219d36d188ca8 (patch)
tree0d34e5ee597b1806ad2698f11955028ef2d5cb0e /bin
parentacbca544fc0d62d7970244cb6be3e9dcc68a1e47 (diff)
downloaddconf-e7705f6d999486b0c840bedf97f219d36d188ca8.tar.gz
dconf(1) tool: add list-locks command
Add a list-locks command to the dconf commandline tool to list the locks that are present in the current configuration. https://bugzilla.gnome.org/show_bug.cgi?id=758864
Diffstat (limited to 'bin')
-rw-r--r--bin/dconf.vala41
1 files changed, 29 insertions, 12 deletions
diff --git a/bin/dconf.vala b/bin/dconf.vala
index d0a0344..954d6c8 100644
--- a/bin/dconf.vala
+++ b/bin/dconf.vala
@@ -42,6 +42,11 @@ void show_help (bool requested, string? command) {
synopsis = " DIR ";
break;
+ case "list-locks":
+ description = "List the locks under a dir";
+ synopsis = " DIR ";
+ break;
+
case "write":
description = "Write a new value to a key";
synopsis = " KEY VALUE ";
@@ -178,6 +183,17 @@ void dconf_list (string?[] args) throws Error {
}
}
+void dconf_list_locks (string?[] args) throws Error {
+ var client = new DConf.Client ();
+ var dir = args[2];
+
+ DConf.verify_dir (dir);
+
+ foreach (var item in client.list_locks (dir)) {
+ print ("%s\n", item);
+ }
+}
+
void dconf_write (string?[] args) throws Error {
var client = new DConf.Client ();
var key = args[2];
@@ -294,18 +310,19 @@ int main (string[] args) {
Intl.setlocale (LocaleCategory.ALL, "");
var map = new CommandMapping[] {
- CommandMapping ("help", dconf_help),
- CommandMapping ("read", dconf_read),
- CommandMapping ("list", dconf_list),
- CommandMapping ("write", dconf_write),
- CommandMapping ("reset", dconf_reset),
- CommandMapping ("compile", dconf_compile),
- CommandMapping ("update", dconf_update),
- CommandMapping ("watch", dconf_watch),
- CommandMapping ("dump", dconf_dump),
- CommandMapping ("load", dconf_load),
- CommandMapping ("blame", dconf_blame),
- CommandMapping ("_complete", dconf_complete)
+ CommandMapping ("help", dconf_help),
+ CommandMapping ("read", dconf_read),
+ CommandMapping ("list", dconf_list),
+ CommandMapping ("list-locks", dconf_list_locks),
+ CommandMapping ("write", dconf_write),
+ CommandMapping ("reset", dconf_reset),
+ CommandMapping ("compile", dconf_compile),
+ CommandMapping ("update", dconf_update),
+ CommandMapping ("watch", dconf_watch),
+ CommandMapping ("dump", dconf_dump),
+ CommandMapping ("load", dconf_load),
+ CommandMapping ("blame", dconf_blame),
+ CommandMapping ("_complete", dconf_complete)
};
try {