[pacman-dev] [PATCH 4/7] imply --print from --print-format

Andrew Gregory andrew.gregory.8 at gmail.com
Sat Oct 12 13:32:07 EDT 2013


--print-format is totally useless without --print.  Implying --print
will also save us the hassle of checking it when we add transaction
option validation.

Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
---
 doc/pacman.8.txt    | 2 +-
 src/pacman/pacman.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/pacman.8.txt b/doc/pacman.8.txt
index 574995c..ccc0a01 100644
--- a/doc/pacman.8.txt
+++ b/doc/pacman.8.txt
@@ -204,7 +204,7 @@ Transaction Options (apply to '-S', '-R' and '-U')
 *\--print-format* <format>::
 	Specify a printf-like format to control the output of the '\--print'
 	operation. The possible attributes are: %n for pkgname, %v for pkgver,
-	%l for location, %r for repo, and %s for size.
+	%l for location, %r for repo, and %s for size.  Implies '\--print'.
 
 Upgrade Options (apply to '-S' and '-U')[[UO]]
 --------------------------------------------
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 308ff38..4e91608 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -574,6 +574,7 @@ static int parsearg_trans(int opt)
 			break;
 		case OP_PRINTFORMAT:
 			check_optarg();
+			config->print = 1;
 			config->print_format = strdup(optarg);
 			break;
 		default:
-- 
1.8.4



More information about the pacman-dev mailing list