aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xscripts/system-search.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/system-search.sh b/scripts/system-search.sh
new file mode 100755
index 0000000..329ead9
--- /dev/null
+++ b/scripts/system-search.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# system-search.sh: List all games from a specific system
+
+# Accepts either one argument (the system name), or the filter to send
+# to vgstash and then the system name.
+
+show_help() {
+ cat <<-FOOBAR
+ system-search.sh [filter] SYSTEM
+
+ filter: The filter to pass to vgstash. "all" by default
+ SYSTEM: The value in the System column to search for. Accepts
+ awk-style regex.
+
+ For example, to check which games for the NES that are in progress,
+ you would do:
+
+ system-search.sh incomplete NES
+FOOBAR
+}
+
+case $# in
+ 1)
+ filter="all"
+ system="$1"
+ ;;
+ 2)
+ filter="$1"
+ system="$2"
+ ;;
+ *)
+ show_help
+ ;;
+esac
+
+vgstash list "${filter}" | awk -F '|' "\$3 ~ \"${system}\""