add a find option to mobyconfig

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack 2016-04-08 13:37:11 +01:00
parent 32c895765f
commit 4993204e9d

View File

@ -2,7 +2,7 @@
if [ $# -ne 2 ] if [ $# -ne 2 ]
then then
printf "usage: $0 [get|exists|watch|path|dir] key\n" printf "usage: $0 [get|exists|watch|path|dir|find] key\n"
exit 0 exit 0
fi fi
@ -69,6 +69,18 @@ then
fi fi
fi fi
if [ $1 == "find" ]
then
if [ -e ${BASE}/${KEY} ]
then
find ${BASE}/${KEY} -type f
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 # 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 # /Database/branch/master/watch/com.docker.driver.amd64-linux.node/etc.node/docker.node/daemon.json.node/tree.live
if [ $1 == "watch" ] if [ $1 == "watch" ]
@ -85,5 +97,5 @@ then
fi fi
fi fi
printf "usage: $0 [get|exists|watch|path|dir] key\n" printf "usage: $0 [get|exists|watch|path|dir|find] key\n"
exit 1 exit 1