~skiqqy/q

9d5eb06b3581e5ddf5962e34828866a656755443 — Stephen Cochrane 2 months ago 5dcf1dc
Fixed bug with -q not working
1 files changed, 4 insertions(+), 4 deletions(-)

M q
M q => q +4 -4
@@ 73,7 73,7 @@ qpop()

	qpeek "$n"
	head -"$stay" "$q" > "$qdir/qt"
	mv "$qdir/qt" "$qdir/q"
	mv "$qdir/qt" "$q"
}

# See: q help peek


@@ 106,9 106,9 @@ qpush()
	read -rp "Title: " title
	read -rp "Desc: "  desc

	if [ "$prio" = "$(tail -1 "$qdir/q" | cut -d: -f3)" ] # If max prio, simply put on top of stack.
	if [ "$prio" = "$(tail -1 "$q" | cut -d: -f3)" ] # If max prio, simply put on top of stack.
	then
		echo "$title:$id:$prio:$desc" >> "$qdir/q"
		echo "$title:$id:$prio:$desc" >> "$q"
		echo "$((++id))" > "$qdir/id"
		return
	fi


@@ 132,7 132,7 @@ qpush()
		echo "$title:$id:$prio:$desc"
		tail -"$l" "$q"
	) > "$qdir/qt"
	mv "$qdir/qt" "$qdir/q"
	mv "$qdir/qt" "$q"

	echo "$((++id))" > "$qdir/id"
}