From 2bdbb1360d21035c079b35c1a98261de95fd9d91 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Mon, 7 May 2012 12:40:30 -0500 Subject: Patch tool: replace elifs with case. Also handles errors. --- tools/patch-tool-mxe | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/tools/patch-tool-mxe b/tools/patch-tool-mxe index 8c30eb1..38d4f17 100755 --- a/tools/patch-tool-mxe +++ b/tools/patch-tool-mxe @@ -73,10 +73,26 @@ function import_patch { git am --keep-cr } -if [ "$cmd" == "init" ]; then - init_git $pkg -elif [ "$cmd" == "import" ]; then - import_patch $pkg -elif [ "$cmd" == "export" ]; then - export_patch $pkg -fi +case "$cmd" in + init) + init_git $pkg + ;; + import) + import_patch $pkg + ;; + export) + export_patch $pkg + ;; + *) + echo "Unrecognized command '${cmd}'" >&2 + cat <