-
Notifications
You must be signed in to change notification settings - Fork 17
/
dconf.sh
107 lines (92 loc) · 1.75 KB
/
dconf.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/env bash
# Automatic generated, DON'T MODIFY IT.
# {{ dconf read
# @cmd Read the value of a key
# @arg key[`_choice_key`]
read() {
:;
}
# }} dconf read
# {{ dconf list
# @cmd List the contents of a dir
# @arg key[`_choice_group`]
list() {
:;
}
# }} dconf list
# {{ dconf write
# @cmd Change the value of a key
# @arg key[`_choice_key`]
write() {
:;
}
# }} dconf write
# {{ dconf reset
# @cmd Reset the value of a key or dir
# @flag -f reset directories
# @arg key[`_choice_key`]
reset() {
:;
}
# }} dconf reset
# {{ dconf compile
# @cmd Compile a binary database from keyfiles
# @arg output
# @arg keyfiledir
compile() {
:;
}
# }} dconf compile
# {{ dconf update
# @cmd Update the system databases
# @arg dbdir
update() {
:;
}
# }} dconf update
# {{ dconf watch
# @cmd Watch a path for changes
# @arg key[`_choice_key`]
watch() {
:;
}
# }} dconf watch
# {{ dconf dump
# @cmd Dump an entire subpath to stdout
# @arg key[`_choice_group`]
dump() {
:;
}
# }} dconf dump
# {{ dconf load
# @cmd Populate a subpath from stdin
# @flag -f ignore changes to non-writable keys
# @arg key[`_choice_group`]
load() {
:;
}
# }} dconf load
. "$ARGC_COMPLETIONS_ROOT/utils/_argc_utils.sh"
_choice_key() {
dconf dump / | \
gawk '{
if (match($0, /^\[(.*)\]$/, arr)) {
dir = "/" arr[1]
} else if (match($0, /^\s*$/)) {
dir = ""
} else if (dir != "" && match($0, /^([^= ]+)=/, arr)) {
print dir "/" arr[1]
}
}' | \
_argc_util_comp_parts /
}
_choice_group() {
dconf dump / | \
gawk '{
if (match($0, /^\[(.*)\]$/, arr)) {
print "/" arr[1] "/"
}
}' | \
_argc_util_comp_parts /
}
command eval "$(argc --argc-eval "$0" "$@")"