From 3a0ab4b43890d97a254bb22b8f65b136394eadc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Sun, 8 Jan 2023 21:02:59 +0100 Subject: [PATCH] Update --help for utils and README.md --- README.md | 9 ++++----- utils/acsmdownloader.cpp | 25 ++++++++++++++----------- utils/adept_activate.cpp | 7 ++++--- utils/adept_loan_mgt.cpp | 10 +++++++--- utils/adept_remove.cpp | 19 ++++++++++++------- 5 files changed, 41 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 7b14aa5..f11aed5 100644 --- a/README.md +++ b/README.md @@ -37,11 +37,10 @@ For libgourou : _externals_ : - * None + * libpugixml _internals_ : - * PugiXML * uPDFParser For utils : @@ -62,7 +61,7 @@ Compilation Use _make_ command - make [CROSS=XXX] [DEBUG=(0*|1)] [STATIC_UTILS=(0*|1)] [BUILD_UTILS=(0|1*)] [BUILD_STATIC=(0*|1)] [BUILD_SHARED=(0|1*)] [all*|clean|ultraclean|build_utils] + make [CROSS=XXX] [DEBUG=(0*|1)] [STATIC_UTILS=(0*|1)] [BUILD_UTILS=(0|1*)] [BUILD_STATIC=(0*|1)] [BUILD_SHARED=(0|1*)] [all*|clean|ultraclean|build_utils|install|uninstall] CROSS can define a cross compiler prefix (ie arm-linux-gnueabihf-) @@ -100,7 +99,7 @@ Then a _/home//.config/adept_ directory is created with all configuration To download an ePub/PDF : - ./utils/acsmdownloader -f + ./utils/acsmdownloader To export your private key (for DeDRM software) : @@ -108,7 +107,7 @@ To export your private key (for DeDRM software) : To remove ADEPT DRM : - ./utils/adept_remove -f + ./utils/adept_remove To list loaned books : diff --git a/utils/acsmdownloader.cpp b/utils/acsmdownloader.cpp index 89f7793..b84efc5 100644 --- a/utils/acsmdownloader.cpp +++ b/utils/acsmdownloader.cpp @@ -181,26 +181,29 @@ private: static void usage(const char* cmd) -{ - std::cout << "Download EPUB file from ACSM request file" << std::endl; - - std::cout << "Usage: " << basename((char*)cmd) << " [(-D|--adept-directory) dir] [(-d|--device-file) device.xml] [(-a|--activation-file) activation.xml] [(-k|--device-key-file) devicesalt] [(-O|--output-dir) dir] [(-o|--output-file) output(.epub|.pdf|.der)] [(-r|--resume)] [(-v|--verbose)] [(-h|--help)] (-f|--acsm-file) file.acsm|(-e|--export-private-key)" << std::endl << std::endl; - - std::cout << " " << "-D|--adept-directory" << "\t" << ".adept directory that must contains device.xml, activation.xml and devicesalt" << std::endl; - std::cout << " " << "-d|--device-file" << "\t" << "device.xml file from eReader" << std::endl; - std::cout << " " << "-a|--activation-file" << "\t" << "activation.xml file from eReader" << std::endl; - std::cout << " " << "-k|--device-key-file" << "\t" << "private device key file (eg devicesalt/devkey.bin) from eReader" << std::endl; +{ + std::cout << basename((char*)cmd) << " download EPUB file from ACSM request file" << std::endl << std::endl; + std::cout << "Usage: " << basename((char*)cmd) << " [OPTIONS] file.acsm" << std::endl << std::endl; + std::cout << "Global Options:" << std::endl; std::cout << " " << "-O|--output-dir" << "\t" << "Optional output directory were to put result (default ./)" << std::endl; std::cout << " " << "-o|--output-file" << "\t" << "Optional output filename (default )" << std::endl; - std::cout << " " << "-f|--acsm-file" << "\t" << "ACSM request file for epub download" << std::endl; + std::cout << " " << "-f|--acsm-file" << "\t" << "Backward compatibility: ACSM request file for epub download" << std::endl; std::cout << " " << "-e|--export-private-key"<< "\t" << "Export private key in DER format" << std::endl; std::cout << " " << "-r|--resume" << "\t\t" << "Try to resume download (in case of previous failure)" << std::endl; std::cout << " " << "-v|--verbose" << "\t\t" << "Increase verbosity, can be set multiple times" << std::endl; std::cout << " " << "-V|--version" << "\t\t" << "Display libgourou version" << std::endl; std::cout << " " << "-h|--help" << "\t\t" << "This help" << std::endl; + std::cout << "ADEPT Options:" << std::endl; + std::cout << " " << "-D|--adept-directory" << "\t" << ".adept directory that must contains device.xml, activation.xml and devicesalt" << std::endl; + std::cout << " " << "-d|--device-file" << "\t" << "device.xml file from eReader" << std::endl; + std::cout << " " << "-a|--activation-file" << "\t" << "activation.xml file from eReader" << std::endl; + std::cout << " " << "-k|--device-key-file" << "\t" << "private device key file (eg devicesalt/devkey.bin) from eReader" << std::endl; + std::cout << std::endl; - std::cout << "Device file, activation file and device key file are optionals. If not set, they are looked into :" << std::endl; + + std::cout << "Environment:" << std::endl; + std::cout << "Device file, activation file and device key file are optionals. If not set, they are looked into :" << std::endl << std::endl; std::cout << " * $ADEPT_DIR environment variable" << std::endl; std::cout << " * /home//.config/adept" << std::endl; std::cout << " * Current directory" << std::endl; diff --git a/utils/adept_activate.cpp b/utils/adept_activate.cpp index 80c8068..466add3 100644 --- a/utils/adept_activate.cpp +++ b/utils/adept_activate.cpp @@ -124,10 +124,11 @@ public: static void usage(const char* cmd) { - std::cout << "Create new device files used by ADEPT DRM" << std::endl; - - std::cout << "Usage: " << basename((char*)cmd) << " (-a|--anonymous) | ( (-u|--username) username [(-p|--password) password] ) [(-O|--output-dir) dir] [(-r|--random-serial)] [(-v|--verbose)] [(-h|--help)]" << std::endl << std::endl; + std::cout << basename((char*)cmd) << " create new device files used by ADEPT DRM" << std::endl << std::endl; + std::cout << "Usage: " << basename((char*)cmd) << " OPTIONS" << std::endl << std::endl; + + std::cout << "Global Options:" << std::endl; std::cout << " " << "-a|--anonymous" << "\t" << "Anonymous account, no need for username/password (Use it only with a DRM removal software)" << std::endl; std::cout << " " << "-u|--username" << "\t\t" << "AdobeID username (ie adobe.com email account)" << std::endl; std::cout << " " << "-p|--password" << "\t\t" << "AdobeID password (asked if not set via command line) " << std::endl; diff --git a/utils/adept_loan_mgt.cpp b/utils/adept_loan_mgt.cpp index 30e9444..807e505 100644 --- a/utils/adept_loan_mgt.cpp +++ b/utils/adept_loan_mgt.cpp @@ -334,11 +334,11 @@ private: static void usage(const char* cmd) { - std::cout << "Manage loaned books" << std::endl; + std::cout << basename((char*)cmd) << " manage loaned books" << std::endl << std::endl; - std::cout << "Usage: " << basename((char*)cmd) << " [(-D|--adept-directory) dir] (-l|--list)|(-d|--delete loanID)|(-R|--return loanID) [(-v|--verbose)] [(-h|--help)]" << std::endl << std::endl; + std::cout << "Usage: " << basename((char*)cmd) << " [OPTIONS]" << std::endl << std::endl; - std::cout << " " << "-D|--adept-directory" << "\t" << ".adept directory that must contains device.xml, activation.xml and devicesalt" << std::endl; + std::cout << "Global Options:" << std::endl; std::cout << " " << "-l|--list" << "\t\t" << "List all loaned books" << std::endl; std::cout << " " << "-r|--return" << "\t\t" << "Return a loaned book" << std::endl; std::cout << " " << "-d|--delete" << "\t\t" << "Delete a loan entry without returning it" << std::endl; @@ -346,7 +346,11 @@ static void usage(const char* cmd) std::cout << " " << "-V|--version" << "\t\t" << "Display libgourou version" << std::endl; std::cout << " " << "-h|--help" << "\t\t" << "This help" << std::endl; + std::cout << "ADEPT Options:" << std::endl; + std::cout << " " << "-D|--adept-directory" << "\t" << ".adept directory that must contains device.xml, activation.xml and devicesalt" << std::endl; std::cout << std::endl; + + std::cout << "Environment:" << std::endl; std::cout << "ADEPT directory is optional. If not set, it's looked into :" << std::endl; std::cout << " * $ADEPT_DIR environment variable" << std::endl; std::cout << " * /home//.config/adept" << std::endl; diff --git a/utils/adept_remove.cpp b/utils/adept_remove.cpp index c2b226d..646e57b 100644 --- a/utils/adept_remove.cpp +++ b/utils/adept_remove.cpp @@ -141,22 +141,27 @@ public: static void usage(const char* cmd) { - std::cout << "Remove ADEPT DRM (from Adobe) of EPUB/PDF file" << std::endl; + std::cout << basename((char*)cmd) << " remove ADEPT DRM (from Adobe) of EPUB/PDF file" << std::endl << std::endl; - std::cout << "Usage: " << basename((char*)cmd) << " [(-D|--adept-directory) dir] [(-d|--device-file) device.xml] [(-a|--activation-file) activation.xml] [(-k|--device-key-file) devicesalt] [(-O|--output-dir) dir] [(-o|--output-file) output(.epub|.pdf|.der)] [(-v|--verbose)] [(-h|--help)] (-f|--input-file) file(.epub|pdf)" << std::endl << std::endl; + std::cout << "Usage: " << basename((char*)cmd) << " [OPTIONS] file(.epub|pdf)" << std::endl << std::endl; - std::cout << " " << "-D|--adept-directory" << "\t" << ".adept directory that must contains device.xml, activation.xml and devicesalt" << std::endl; - std::cout << " " << "-d|--device-file" << "\t" << "device.xml file from eReader" << std::endl; - std::cout << " " << "-a|--activation-file" << "\t" << "activation.xml file from eReader" << std::endl; - std::cout << " " << "-k|--device-key-file" << "\t" << "private device key file (eg devicesalt/devkey.bin) from eReader" << std::endl; + std::cout << "Global Options:" << std::endl; std::cout << " " << "-O|--output-dir" << "\t" << "Optional output directory were to put result (default ./)" << std::endl; std::cout << " " << "-o|--output-file" << "\t" << "Optional output filename (default inplace DRM removal>)" << std::endl; - std::cout << " " << "-f|--input-file" << "\t" << "EPUB/PDF file to process" << std::endl; + std::cout << " " << "-f|--input-file" << "\t" << "Backward compatibility: EPUB/PDF file to process" << std::endl; std::cout << " " << "-v|--verbose" << "\t\t" << "Increase verbosity, can be set multiple times" << std::endl; std::cout << " " << "-V|--version" << "\t\t" << "Display libgourou version" << std::endl; std::cout << " " << "-h|--help" << "\t\t" << "This help" << std::endl; + std::cout << "ADEPT Options:" << std::endl; + std::cout << " " << "-D|--adept-directory" << "\t" << ".adept directory that must contains device.xml, activation.xml and devicesalt" << std::endl; + std::cout << " " << "-d|--device-file" << "\t" << "device.xml file from eReader" << std::endl; + std::cout << " " << "-a|--activation-file" << "\t" << "activation.xml file from eReader" << std::endl; + std::cout << " " << "-k|--device-key-file" << "\t" << "private device key file (eg devicesalt/devkey.bin) from eReader" << std::endl; + std::cout << std::endl; + + std::cout << "Environment:" << std::endl; std::cout << "Device file, activation file and device key file are optionals. If not set, they are looked into :" << std::endl; std::cout << " * $ADEPT_DIR environment variable" << std::endl; std::cout << " * /home//.config/adept" << std::endl;