From 355eb765ff47b0855a6f5655312608d3264e70bf Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sun, 27 Aug 2023 17:19:36 +0100 Subject: move resources/scripts/ to script/ Signed-off-by: Leah Rowe --- script/build/command/options | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 script/build/command/options (limited to 'script/build/command') diff --git a/script/build/command/options b/script/build/command/options new file mode 100755 index 00000000..84a9a3fb --- /dev/null +++ b/script/build/command/options @@ -0,0 +1,31 @@ +#!/usr/bin/env sh + +# Copyright (c) 2023 Leah Rowe +# SPDX-License-Identifier: MIT + +. "include/err.sh" + +items=1 + +main() +{ + [ $# -gt 0 ] || \ + err "No argument given" + listitems "${1}" || err "No items present under: ${1}" +} + +listitems() +{ + [ -d "${1}" ] || \ + err "Directory not does exist: ${1}" + for x in "${1}/"*; do + # -e used because this is for files *or* directories + [ -e "${x}" ] || continue + [ "${x##*/}" = "build.list" ] && continue + printf "%s\n" "${x##*/}" + items=0 + done + return ${items} +} + +main $@ -- cgit v1.2.1