diff options
author | Leah Rowe <info@minifree.org> | 2017-07-10 18:23:51 +0000 |
---|---|---|
committer | Gogs <gogitservice@gmail.com> | 2017-07-10 18:23:51 +0000 |
commit | c41354732a1e863be0dfc62218f29df81479c151 (patch) | |
tree | e1f96f35c24e5c419dc5fee9743f2594eac2d4cf | |
parent | 65d9a3d2500797bfbb6b70a43d1894d0e48a6697 (diff) | |
parent | 9b5d012ec4c2cfa32f05e3a668bcd2b2d17507ac (diff) | |
download | librebootfr-c41354732a1e863be0dfc62218f29df81479c151.tar.gz librebootfr-c41354732a1e863be0dfc62218f29df81479c151.zip |
Merge branch 'libs/project-cruft' of kragle/libreboot into master
-rwxr-xr-x | libs/project | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/libs/project b/libs/project index 43c6a82c..2728d4fa 100755 --- a/libs/project +++ b/libs/project @@ -556,56 +556,54 @@ project_arguments_targets() { } project_usage_actions() { - local project=$1 + local project="$1" shift printf '\n%s\n' 'Generic actions:' - for action in $PROJECT_ACTIONS_GENERIC - do - if function_check "$action" - then - printf '%s\n' " $action" - fi - done + ( + for action in ${PROJECT_ACTIONS_GENERIC}; do + if function_check "${action}"; then + printf '%s\n' " ${action}" + fi + done + ) - if [ $# -gt 0 ] - then + if [[ "$#" -gt 0 ]]; then printf '\n%s\n' 'Specific actions:' - for action in "$@" - do - printf '%s\n' " $action" - done + ( + for action in "$@"; do + printf '%s\n' " ${action}" + done + ) fi } project_usage_arguments() { - local project=$1 + local project="$1" shift printf '\n%s\n' 'Arguments:' - project_usage_arguments_recursive "$project" " " "$@" + project_usage_arguments_recursive "${project}" ' ' "$@" } project_usage_arguments_recursive() { - local project=$1 + local project="$1" shift - local spacing=$1 + local spacing="$1" shift local action_helper_arguments local argument - action_helper_arguments=$( project_action_helper "arguments" "$project" "$@" ) + action_helper_arguments="$(project_action_helper 'arguments' "${project}" "$@")" - if ! [ -z "$action_helper_arguments" ] - then - printf '%s\n' "$action_helper_arguments" | while read argument - do - printf '%s\n' "$spacing$argument" - project_usage_arguments_recursive "$project" " $spacing" "$@" "$argument" + if [[ -n "${action_helper_arguments}" ]]; then + for argument in ${action_helper_arguments}; do + printf '%s\n' "${spacing}${argument}" + project_usage_arguments_recursive "${project}" " ${spacing}" "$@" "${argument}" done fi } |