From 9d035e20f45b48ea5277efd6e2c07d6abcd51f45 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Wed, 11 May 2022 11:30:22 +0300 Subject: [PATCH 1/3] silent if autocompleting --- bake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bake b/bake index 402f024..841335f 100755 --- a/bake +++ b/bake @@ -1,5 +1,5 @@ #!/bin/bash -## VERSION 22.4.5 +## VERSION 22.5.11 ## BASH-MAKE ========================================================== ## Utility to mimick some of GNU Make behavior, but run in a single ## bash shell. This executable can be used as the Bakefile, too, @@ -42,7 +42,7 @@ complete -F _bake_complete bake # Run me as: source <( $BAKE __autocomplete__ ) ' exit; } -_flines() { cat "$BAKEFILE" | \ +_flines() { cat "$BAKEFILE" 2>/dev/null | \ grep -E '^([^_][a-zA-Z0-9_\.\-]+)\(\) {.*'; } _menu() { _flines | while read line; do if [[ "$line" =~ ([a-zA-Z0-9_\.\-]+)\(\).\{[\ #]*(.*) ]]; then From 3adf7fb39acea09e21ee5dc25e5ed817bcd972c2 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Thu, 19 May 2022 19:33:18 +0300 Subject: [PATCH 2/3] set+x replacement --- bake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bake b/bake index 841335f..a976785 100755 --- a/bake +++ b/bake @@ -1,5 +1,5 @@ #!/bin/bash -## VERSION 22.5.11 +## VERSION 22.5.19 ## BASH-MAKE ========================================================== ## Utility to mimick some of GNU Make behavior, but run in a single ## bash shell. This executable can be used as the Bakefile, too, @@ -113,6 +113,8 @@ _update_self() { "https://raw.githubusercontent.com/moonq/bake/main/bake" chmod +x "$0" } +@() { echo +"$@" >&2; "$@"; } # Print command before running it + for (( i=1; i<=$#; i++ )); do if [[ $i -eq 1 ]]; then if [[ "${!i}" = "__list__" ]]; then _flines | sed 's/().*//'; exit; fi From ec55e6387a1cacf6644d72643f5dfb607701c0e5 Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Thu, 19 May 2022 19:44:07 +0300 Subject: [PATCH 3/3] compl --- bake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bake b/bake index a976785..0e9bebe 100755 --- a/bake +++ b/bake @@ -158,7 +158,7 @@ else "$@" else # but there is no defined completion - compgen -o plusdirs -f -- "${@: -1}" + compgen -f -d -- "${@: -1}" fi else # no such command