diff options
author | 2019-11-04 15:26:13 -0800 | |
---|---|---|
committer | 2019-11-04 15:26:13 -0800 | |
commit | c2f8abf013b22c335f44241a6a552a7767e73419 (patch) | |
tree | c499b1e429e144af744629a060c71739feaa126c | |
parent | f8e0d186cd58d38b4097dd5d8917d639c3678fca (diff) | |
download | ldid-c2f8abf013b22c335f44241a6a552a7767e73419.tar.gz ldid-c2f8abf013b22c335f44241a6a552a7767e73419.tar.zst ldid-c2f8abf013b22c335f44241a6a552a7767e73419.zip |
The behavior of usage made absolutely no sense :/.v2.1.2
-rw-r--r-- | ldid.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -2773,6 +2773,13 @@ Bundle Sign(const std::string &root, Folder &folder, const std::string &key, con #endif } +static void usage(const char *argv0) { + fprintf(stderr, "usage: %s -S[entitlements.xml] <binary>\n", argv0); + fprintf(stderr, " %s -e MobileSafari\n", argv0); + fprintf(stderr, " %s -S cat\n", argv0); + fprintf(stderr, " %s -Stfp.xml gdb\n", argv0); +} + #ifndef LDID_NOTOOLS int main(int argc, char *argv[]) { #ifndef LDID_NOSMIME @@ -2829,11 +2836,8 @@ int main(int argc, char *argv[]) { std::vector<std::string> files; if (argc == 1) { - fprintf(stderr, "usage: %s -S[entitlements.xml] <binary>\n", argv[0]); - fprintf(stderr, " %s -e MobileSafari\n", argv[0]); - fprintf(stderr, " %s -S cat\n", argv[0]); - fprintf(stderr, " %s -Stfp.xml gdb\n", argv[0]); - exit(0); + usage(argv[0]); + return 0; } for (int argi(1); argi != argc; ++argi) @@ -2981,16 +2985,16 @@ int main(int argc, char *argv[]) { } break; default: - goto usage; + usage(argv[0]); + return 1; break; } _assert(flag_S || key.empty()); _assert(flag_S || flag_I == NULL); - if (files.empty()) usage: { - exit(0); - } + if (files.empty()) + return 0; size_t filei(0), filee(0); _foreach (file, files) try { |