~alias/polybase-devel

Added filtering by kind v1 PROPOSED

Luc-Saccoccio: 1
 Added filtering by kind

 1 files changed, 13 insertions(+), 11 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~alias/polybase-devel/patches/43152/mbox | git am -3
Learn more about email & git

[PATCH] Added filtering by kind Export this patch

Signed-off-by: Luc-Saccoccio <lucsaccoccio@disroot.org>
---
 polybase | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/polybase b/polybase
index 3828537..c338cd8 100755
--- a/polybase
+++ b/polybase
@@ -108,17 +108,19 @@ front_page() {
			echo '=> / Change Individually'
			echo ;;
	esac
	echo '### Courses'
	sqlite3 "$DB" '.headers OFF' '.mode tabs' 'SELECT code, kind, part, name, quantity FROM courses ORDER BY code, kind, part;' | while read -r row
	do
		code=$(echo "$row" | cut -f 1)
		kind=$(echo "$row" | cut -f 2)
		part=$(echo "$row" | cut -f 3)
		name=$(echo "$row" | cut -f 4)
		quantity=$(echo "$row" | cut -f 5)
		link=$("$links" && echo "/${code}_${kind}_${part}")
		echo "$1$link $code, $name ($kind partie $part): $quantity"
	done
    sqlite3 "$DB" '.headers OFF' '.mode tabs' 'SELECT kind FROM courses GROUP BY kind;' | while read -r kind
    do
        echo "### ${kind}"
        sqlite3 "$DB" '.headers OFF' '.mode tabs' "SELECT code, part, name, quantity FROM courses WHERE kind=\"${kind}\" ORDER BY code, kind, part;" | while read -r row
        do
            code=$(echo "$row" | cut -f 1)
            part=$(echo "$row" | cut -f 2)
            name=$(echo "$row" | cut -f 3)
            quantity=$(echo "$row" | cut -f 4)
            link=$("$links" && echo "/${code}_${kind}_${part}")
            echo "$1$link $code, $name (Partie $part): $quantity"
        done
    done
	exit
}

-- 
2.38.1