~alias/polybase-devel

Added filtering by kind v2 PROPOSED

Luc-Saccoccio: 1
 Added filtering by kind

 1 files changed, 14 insertions(+), 12 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/43155/mbox | git am -3
Learn more about email & git

[PATCH v2] Added filtering by kind Export this patch

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

diff --git a/polybase b/polybase
index 3828537..ebd06c8 100755
--- a/polybase
+++ b/polybase
@@ -1,5 +1,5 @@
#!/bin/sh

#!/bin/sh
MAINTAINER_EMAIL="Allen Sobot <chilledfrogs@disroot.org>"
DB=${DB=/polybase.db}
HEADER="# ALIAS 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 DISTINCT kind FROM courses;' | 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