diff --git a/README.md b/README.md index b63ef6d8..a8bba1f4 100644 --- a/README.md +++ b/README.md @@ -364,7 +364,7 @@ ishmael ~ # bastille list You can also list non-running containers with `bastille list containers`. In the same manner you can list archived `logs`, downloaded `templates`, and -`releases`. +`releases`. Providing the `-j` flag to list alone will result in JSON output. bastille service diff --git a/usr/local/share/bastille/list.sh b/usr/local/share/bastille/list.sh index 33f493f3..97ec4616 100644 --- a/usr/local/share/bastille/list.sh +++ b/usr/local/share/bastille/list.sh @@ -32,12 +32,17 @@ . /usr/local/etc/bastille/bastille.conf usage() { - echo -e "${COLOR_RED}Usage: bastille list [release|template|(jail|container)|log].${COLOR_RESET}" + echo -e "${COLOR_RED}Usage: bastille list [-j] [release|template|(jail|container)|log].${COLOR_RESET}" exit 1 } if [ $# -eq 0 ]; then - jls -N + jls -N +fi + +if [ "$1" == "-j" ]; then + jls -N --libxo json + exit 0 fi if [ $# -gt 0 ]; then