From 731c4f711b8bd12bfe8e86dcf80ca84bb38eba0e Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 26 Jan 2020 09:19:50 -0500 Subject: Add --is-encrypted and --requires-password (fixes #390) Allow exit status-based checking of whether a file is encrypted or requires a password without necessarily supplying the correct password. Useful for scripting. --- manual/qpdf-manual.xml | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'manual') diff --git a/manual/qpdf-manual.xml b/manual/qpdf-manual.xml index 317ce04a..3f455d83 100644 --- a/manual/qpdf-manual.xml +++ b/manual/qpdf-manual.xml @@ -665,6 +665,40 @@ make + + + + + Silently exit with status 0 if the file is encrypted or status + 2 if the file is not encrypted. This is useful for shell + scripts. Other options are ignored if this is given. This + option is mutually exclusive with + . Both this option and + exit with status 2 for + non-encrypted files. + + + + + + + + Silently exit with status 0 if a password (other than as + supplied) is required. Exit with status 2 if the file is not + encrypted. Exit with status 3 if the file is encrypted but + requires no password or the correct password has been + supplied. This is useful for shell scripts. Note that any + supplied password is used when opening the file. When used + with a option, this option can be + used to check the correctness of the password. In that case, + an exit status of 3 means the file works with the supplied + password. This option is mutually exclusive with + . Both this option and + exit with status 2 for + non-encrypted files. + + + @@ -4675,6 +4709,23 @@ print "\n"; + + + CLI Enhancements + + + + + Added options and + for testing whether a + file is encrypted or requires a password other than the + supplied (or empty) password. These communicate via exit + status, making them useful for shell scripts. They also work + on encrypted files with unknown passwords. + + + + -- cgit v1.2.3-54-g00ecf