From 017536123a5d334759ed54aff610b22a8d6c8254 Mon Sep 17 00:00:00 2001 From: Ze Libertine Gamer Date: Thu, 3 Nov 2016 07:02:05 -0700 Subject: Improve error handling in shell scripts --- scripts/system-search.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts/system-search.sh') diff --git a/scripts/system-search.sh b/scripts/system-search.sh index 329ead9..f1a1aad 100755 --- a/scripts/system-search.sh +++ b/scripts/system-search.sh @@ -1,10 +1,15 @@ -#!/bin/bash +#!/usr/bin/env 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. +# Set options for improved robustness +set -o errexit +set -o pipefail +set -o nounset + show_help() { cat <<-FOOBAR system-search.sh [filter] SYSTEM -- cgit v1.2.3-54-g00ecf