Elektra  0.8.25
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 mount points. 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

# Backup-and-Restore: /tests/complete/examples
# Create the keys we use for the examples
kdb set /tests/complete/examples/kdb-complete/level1 foo
kdb set /tests/complete/examples/kdb-complete/lvl1/lvl2 bar
kdb set /tests/complete/examples/kdb-complete/lvl1/lvl2/lvl3/lvl4/lvl5 fizz
kdb set /tests/complete/examples/kdb-complete/buzz fizzBuzz
kdb set /tests/complete/examples/kdb-complete/#array_1 asdf
kdb set /tests/complete/examples/kdb-complete/% nothing
# list suggestions for namespaces starting with us, only the current level
kdb complete us --max-depth=1
#> user/
# list suggestions for namespaces starting with user, only the current level
kdb complete user --max-depth=1
#> user/
# list suggestions for the namespace user, only the next level as it ends with /
# note the difference to the previous example, which uses no trailing /
kdb complete user/ --max-depth=1
# STDOUT-REGEX: .+
# list all possible namespaces or mount points, only the current level
kdb complete --max-depth=1
# STDOUT-REGEX: .+
# list suggestions for /tests/complete/examples/kdb-complete, only the current level
kdb complete /tests/complete/examples/kdb-complete --max-depth=1
#> user/tests/complete/examples/kdb-complete/
# list suggestions for /tests/complete/examples/kdb-complete/, only the next level
# again, note the difference to the previous example which has no trailing /
kdb complete /tests/complete/examples/kdb-complete/ --max-depth=1
#> user/tests/complete/examples/kdb-complete/%
#> user/tests/complete/examples/kdb-complete/#array_1
#> user/tests/complete/examples/kdb-complete/buzz
#> user/tests/complete/examples/kdb-complete/level1
#> user/tests/complete/examples/kdb-complete/lvl1/
# list suggestions for /tests/complete/examples/kdb-complete which are minimum 2 levels
# away from that key, and maximum 4 levels away
kdb complete /tests/complete/examples/kdb-complete/ --min-depth=2 --max-depth=4
#> user/tests/complete/examples/kdb-complete/lvl1/lvl2/lvl3/
#> user/tests/complete/examples/kdb-complete/lvl1/lvl2/lvl3/lvl4/
kdb rm -r user/tests/complete/examples/kdb-complete

SEE ALSO