diff options
author | Per Bothner <per@bothner.com> | 1992-09-03 21:14:53 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1992-09-03 21:14:53 +0000 |
commit | a51d4b418b6e8a3f94b4f5420adee482b30b1213 (patch) | |
tree | 4e11f535847b7640e30d852511e93a8b73f7f6cf /binutils | |
parent | 3c64303a4e82431359edc3619bebdf3c7cfb40d8 (diff) | |
download | gdb-a51d4b418b6e8a3f94b4f5420adee482b30b1213.zip gdb-a51d4b418b6e8a3f94b4f5420adee482b30b1213.tar.gz gdb-a51d4b418b6e8a3f94b4f5420adee482b30b1213.tar.bz2 |
* Makefile.in: Let's call it version 2.0.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/copy.c | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/binutils/copy.c b/binutils/copy.c index 4bd6b4b..e1ac8a8 100644 --- a/binutils/copy.c +++ b/binutils/copy.c @@ -47,11 +47,19 @@ void usage() { fprintf(stderr, - "Usage %s [-S][-s srcfmt] [-d dtfmt] [-b bothfmts] infile [outfile] [-V]\n", + "Usage %s [-S][-s srcfmt] [-d dtfmt] [-b bothfmts] infile [outfile] [-vV]\n", program_name); exit(1); } +static +void +strip_usage() +{ + fprintf(stderr, "Usage %s [-vV] filename ...\n", program_name); + exit(1); +} + /* Create a temp file in the same directory as supplied */ static @@ -385,9 +393,8 @@ main(argc, argv) char *argv[]; { int i; - int show_version; + int show_version = 0; program_name = argv[0]; - show_version = 0; bfd_init(); @@ -396,6 +403,38 @@ main(argc, argv) is_strip = (i >= 5 && strcmp(program_name+i-5,"strip")); } + if (is_strip) + { + for (i = 1; i < argc; i++) + { + if (argv[i][0] != '-') + break; + if (argv[i][1] == '-') { + i++; + break; + } + switch (argv[i][1]) { + case 'V': + show_version = true; + break; + case 'v': + verbose = true; + show_version = true; + break; + default: + strip_usage(); + } + } + if (show_version) + printf ("%s version %s\n", program_name, program_version); + for ( ; i < argc; i++) { + char *tmpname = make_tempname(argv[i]); + copy_file(argv[i], tmpname); + rename(tmpname, argv[i]); + } + return 0; + } + for (i = 1; i < argc; i++) { if (argv[i][0] == '-') { @@ -404,6 +443,7 @@ main(argc, argv) show_version = true; break; case 'v': + show_version = true; verbose = true; break; case 'b': |