#!/bin/sh

## Copyright (C) 2006-2013 Daniel Baumann <mail@daniel-baumann.ch>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.


set -e

, /usr/share/lxc/lxc.functions

_LXC_DIRECTORY="${lxc_path}"

if [ ! -e "${_LXC_DIRECTORY}" ]
then
	echo "E: ${_LXC_DIRECTORY}: no such directory." >&2
	exit 1
fi

cd "${_LXC_DIRECTORY}"

_DIRECTORIES="$(find . -maxdepth 1 -type d -and -not -name ".*" -and -not -name lost+found | sort)"

for _DIRECTORY in ${_DIRECTORIES}
do
	ls -d ${@} $(basename ${_DIRECTORY})
done
