[pacman-dev] [PATCH 3/6] pacman: use exit status 0 for --help and --version

Andrew Gregory andrew.gregory.8 at gmail.com
Mon Jan 13 23:01:43 EST 2014


The user requesting usage or version information is not an error.

Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
---
 src/pacman/pacman.c            | 4 ++--
 test/pacman/tests/pacman001.py | 2 +-
 test/pacman/tests/pacman002.py | 2 +-
 test/pacman/tests/pacman003.py | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 748bc54..d7072d2 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -889,11 +889,11 @@ static int parseargs(int argc, char *argv[])
 	}
 	if(config->help) {
 		usage(config->op, mbasename(argv[0]));
-		return 2;
+		cleanup(0);
 	}
 	if(config->version) {
 		version();
-		return 2;
+		cleanup(0);
 	}
 
 	/* parse all other options */
diff --git a/test/pacman/tests/pacman001.py b/test/pacman/tests/pacman001.py
index d467e3f..1d3a36a 100644
--- a/test/pacman/tests/pacman001.py
+++ b/test/pacman/tests/pacman001.py
@@ -2,4 +2,4 @@
 
 self.args = "--version"
 
-self.addrule("PACMAN_RETCODE=2")
+self.addrule("PACMAN_RETCODE=0")
diff --git a/test/pacman/tests/pacman002.py b/test/pacman/tests/pacman002.py
index c021725..2add614 100644
--- a/test/pacman/tests/pacman002.py
+++ b/test/pacman/tests/pacman002.py
@@ -2,4 +2,4 @@
 
 self.args = "--help"
 
-self.addrule("PACMAN_RETCODE=2")
+self.addrule("PACMAN_RETCODE=0")
diff --git a/test/pacman/tests/pacman003.py b/test/pacman/tests/pacman003.py
index b527594..a80e2d6 100644
--- a/test/pacman/tests/pacman003.py
+++ b/test/pacman/tests/pacman003.py
@@ -2,4 +2,4 @@
 
 self.args = "-S --help"
 
-self.addrule("PACMAN_RETCODE=2")
+self.addrule("PACMAN_RETCODE=0")
-- 
1.8.5.2



More information about the pacman-dev mailing list