diff mbox

[pacman-dev] remove unneeded break argument from option parsing

Message ID 20180501165404.13657-1-rafa.almas@gmail.com
State Accepted, archived
Headers show

Commit Message

Rafael Ascensão May 1, 2018, 4:54 p.m. UTC
Some scripts are using `break 2` to break out of the option parsing
loop.

Since a single `break` is sufficient in these cases, remove the extra
argument.

Signed-off-by: Rafael Ascensão <rafa.almas@gmail.com>
---

Greetings,

This is just a small patch meant to remove some unnecessary noise from
the option parsing loop.

The lines are not technically wrong but may cause some confusion or
wonder why they exist in the first place.

Thanks for spending your time on my first contribution to an official
Arch Linux project!


 scripts/libmakepkg/source.sh.in | 2 +-
 scripts/makepkg.sh.in           | 2 +-
 scripts/pacman-db-upgrade.sh.in | 2 +-
 scripts/pacman-key.sh.in        | 2 +-
 scripts/pkgdelta.sh.in          | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/scripts/libmakepkg/source.sh.in b/scripts/libmakepkg/source.sh.in
index 02bb16f5..5d7df732 100644
--- a/scripts/libmakepkg/source.sh.in
+++ b/scripts/libmakepkg/source.sh.in
@@ -48,7 +48,7 @@  download_sources() {
 				get_vcs=0
 				;;
 			*)
-				break 2
+				break
 				;;
 		esac
 		shift
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index eee8a56c..be80cc0e 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1277,7 +1277,7 @@  while true; do
 		-h|--help)        usage; exit $E_OK ;;
 		-V|--version)     version; exit $E_OK ;;
 
-		--)               OPT_IND=0; shift; break 2;;
+		--)               OPT_IND=0; shift; break ;;
 	esac
 	shift
 done
diff --git a/scripts/pacman-db-upgrade.sh.in b/scripts/pacman-db-upgrade.sh.in
index 9d447cbc..a529dadd 100644
--- a/scripts/pacman-db-upgrade.sh.in
+++ b/scripts/pacman-db-upgrade.sh.in
@@ -103,7 +103,7 @@  while true; do
 		-h|--help)    usage; exit 0 ;;
 		--nocolor)    USE_COLOR='n' ;;
 		-V|--version) version; exit 0 ;;
-		-- )          shift; break 2 ;;
+		--)           shift; break ;;
 	esac
 	shift
 done
diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in
index 060d8369..01e0bd5e 100644
--- a/scripts/pacman-key.sh.in
+++ b/scripts/pacman-key.sh.in
@@ -557,7 +557,7 @@  while (( $# )); do
 		-h|--help)        usage; exit 0 ;;
 		-V|--version)     version; exit 0 ;;
 
-		--)               shift; break 2 ;;
+		--)               shift; break ;;
 	esac
 	shift
 done
diff --git a/scripts/pkgdelta.sh.in b/scripts/pkgdelta.sh.in
index 4500dd75..316d6395 100644
--- a/scripts/pkgdelta.sh.in
+++ b/scripts/pkgdelta.sh.in
@@ -202,7 +202,7 @@  while :; do
 			shift ;;
 		--)
 			shift
-			break 2 ;;
+			break ;;
 	esac
 	shift
 done