add path option to mobyconfig

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack 2016-04-08 13:08:25 +01:00
parent 64b16c1dc3
commit 888ef34ffc

View File

@ -2,7 +2,7 @@
if [ $# -ne 2 ]
then
printf "usage: $0 [get|exists|watch] key\n"
printf "usage: $0 [get|exists|watch|path] key\n"
exit 0
fi
@ -52,6 +52,18 @@ then
fi
fi
if [ $1 == "path" ]
then
if [ -f ${BASE}/${KEY} ]
then
printf ${BASE}/${KEY}
exit 0
else
printf "No such key: ${KEY}\n" 1>&2
exit 1
fi
fi
# might be nicer if watch returned a file descriptor not a path
# /Database/branch/master/watch/com.docker.driver.amd64-linux.node/etc.node/docker.node/daemon.json.node/tree.live
if [ $1 == "watch" ]
@ -68,5 +80,5 @@ then
fi
fi
printf "usage: $0 [get|exists|watch] key\n"
printf "usage: $0 [get|exists|watch|path] key\n"
exit 1