diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2009-02-24 12:34:25 (GMT) |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2009-02-24 12:34:25 (GMT) |
commit | 474641ca07d28ed77b73d96a47eb05d0331c698f (patch) | |
tree | a13c83bf652b62b0882e374331b863f5fffcd7c9 /src/patchelf.cc | |
parent | 230ef437e63db4954dd7cb694798fc0bfb0a70b0 (diff) | |
download | patchelf-474641ca07d28ed77b73d96a47eb05d0331c698f.zip patchelf-474641ca07d28ed77b73d96a47eb05d0331c698f.tar.gz patchelf-474641ca07d28ed77b73d96a47eb05d0331c698f.tar.bz2 |
* Implement --version, --help.
Diffstat (limited to 'src/patchelf.cc')
-rw-r--r-- | src/patchelf.cc | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/patchelf.cc b/src/patchelf.cc index 74ce47d..9b17192 100644 --- a/src/patchelf.cc +++ b/src/patchelf.cc @@ -1072,9 +1072,8 @@ static void patchElf() } -int main(int argc, char * * argv) +void showHelp(const string & progName) { - if (argc <= 1) { fprintf(stderr, "syntax: %s\n\ [--set-interpreter FILENAME]\n\ [--print-interpreter]\n\ @@ -1083,7 +1082,15 @@ int main(int argc, char * * argv) [--print-rpath]\n\ [--force-rpath]\n\ [--debug]\n\ - FILENAME\n", argv[0]); + [--version]\n\ + FILENAME\n", progName.c_str()); +} + + +int main(int argc, char * * argv) +{ + if (argc <= 1) { + showHelp(argv[0]); return 1; } @@ -1127,6 +1134,14 @@ int main(int argc, char * * argv) else if (arg == "--debug") { debugMode = true; } + else if (arg == "--help") { + showHelp(argv[0]); + return 0; + } + else if (arg == "--version") { + printf(PACKAGE_STRING "\n"); + return 0; + } else break; } |