Elektra  0.8.23
kdb-complete(1) -- Show suggestions how to complete a given path

kdb complete [path]

Where path is the path for which the user would like to receive completion suggestion. If path is not specified, it will show every possible completion. Its synonymous to calling kdb complete "".

DESCRIPTION

Show suggestions how the current name could be completed. Suggestions will include existing key names, path segments of existing key names, namespaces and mountpoints. Additionally, the output will indicate whether the given path is a node or a leaf in the hierarchy of keys, nodes end with '/' as opposed to leaves. It will also work for cascading keys, and will additionally display a cascading key's namespace in the output to indicate from which namespace this suggestion originates from.

OPTIONS

EXAMPLES

1 # Backup-and-Restore: /sw/elektra/examples
2 
3 # Create the keys we use for the examples
4 kdb set /sw/elektra/examples/kdb-complete/level1 foo
5 kdb set /sw/elektra/examples/kdb-complete/lvl1/lvl2 bar
6 kdb set /sw/elektra/examples/kdb-complete/lvl1/lvl2/lvl3/lvl4/lvl5 fizz
7 kdb set /sw/elektra/examples/kdb-complete/buzz fizzBuzz
8 kdb set /sw/elektra/examples/kdb-complete/#array_1 asdf
9 kdb set /sw/elektra/examples/kdb-complete/% nothing
10 
11 # list suggestions for namespaces starting with us, only the current level
12 kdb complete us --max-depth=1
13 #> user/
14 
15 # list suggestions for namespaces starting with user, only the current level
16 kdb complete user --max-depth=1
17 #> user/
18 
19 # list suggestions for the namespace user, only the next level as it ends with /
20 # note the difference to the previous example, which uses no trailing /
21 kdb complete user/ --max-depth=1
22 # STDOUT-REGEX: .+
23 
24 # list all possible namespaces or mountpoints, only the current level
25 kdb complete --max-depth=1
26 # STDOUT-REGEX: .+
27 
28 # list suggestions for /sw/elektra/examples/kdb-complete, only the current level
29 kdb complete /sw/elektra/examples/kdb-complete --max-depth=1
30 #> user/sw/elektra/examples/kdb-complete/
31 
32 # list suggestions for /sw/elektra/examples/kdb-complete/, only the next level
33 # again, note the difference to the previous example which has no trailing /
34 kdb complete /sw/elektra/examples/kdb-complete/ --max-depth=1
35 #> user/sw/elektra/examples/kdb-complete/%
36 #> user/sw/elektra/examples/kdb-complete/#array_1
37 #> user/sw/elektra/examples/kdb-complete/buzz
38 #> user/sw/elektra/examples/kdb-complete/level1
39 #> user/sw/elektra/examples/kdb-complete/lvl1/
40 
41 # list suggestions for /sw/elektra/examples/kdb-complete which are minimum 2 levels
42 # away from that key, and maximum 4 levels away
43 kdb complete /sw/elektra/examples/kdb-complete/ --min-depth=2 --max-depth=4
44 #> user/sw/elektra/examples/kdb-complete/lvl1/lvl2/lvl3/
45 #> user/sw/elektra/examples/kdb-complete/lvl1/lvl2/lvl3/lvl4/
46 
47 kdb rm -r user/sw/elektra/examples/kdb-complete

SEE ALSO