Deleted Added
full compact
ar.c (190162) ar.c (201382)
1/*-
2 * Copyright (c) 2007 Kai Wang
3 * Copyright (c) 2007 Tim Kientzle
4 * Copyright (c) 2007 Joseph Koshy
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 45 unchanged lines hidden (view full) ---

54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE.
59 */
60
61#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2007 Kai Wang
3 * Copyright (c) 2007 Tim Kientzle
4 * Copyright (c) 2007 Joseph Koshy
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 45 unchanged lines hidden (view full) ---

54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE.
59 */
60
61#include <sys/cdefs.h>
62__FBSDID("$FreeBSD: head/usr.bin/ar/ar.c 190162 2009-03-20 17:11:45Z kientzle $");
62__FBSDID("$FreeBSD: head/usr.bin/ar/ar.c 201382 2010-01-02 10:09:20Z ed $");
63
64#include <sys/queue.h>
65#include <sys/types.h>
66#include <archive.h>
67#include <errno.h>
68#include <getopt.h>
69#include <libgen.h>
70#include <stdio.h>

--- 273 unchanged lines hidden (view full) ---

344{
345
346 if (strchr(valid_modes, bsdar->mode) == NULL)
347 bsdar_errc(bsdar, EX_USAGE, 0,
348 "Option %s is not permitted in mode -%c", opt, bsdar->mode);
349}
350
351static void
63
64#include <sys/queue.h>
65#include <sys/types.h>
66#include <archive.h>
67#include <errno.h>
68#include <getopt.h>
69#include <libgen.h>
70#include <stdio.h>

--- 273 unchanged lines hidden (view full) ---

344{
345
346 if (strchr(valid_modes, bsdar->mode) == NULL)
347 bsdar_errc(bsdar, EX_USAGE, 0,
348 "Option %s is not permitted in mode -%c", opt, bsdar->mode);
349}
350
351static void
352bsdar_usage()
352bsdar_usage(void)
353{
354
355 (void)fprintf(stderr, "usage: ar -d [-Tjsvz] archive file ...\n");
356 (void)fprintf(stderr, "\tar -m [-Tjsvz] archive file ...\n");
357 (void)fprintf(stderr, "\tar -m [-Tabijsvz] position archive file ...\n");
358 (void)fprintf(stderr, "\tar -p [-Tv] archive [file ...]\n");
359 (void)fprintf(stderr, "\tar -q [-Tcjsvz] archive file ...\n");
360 (void)fprintf(stderr, "\tar -r [-Tcjsuvz] archive file ...\n");
361 (void)fprintf(stderr, "\tar -r [-Tabcijsuvz] position archive file ...\n");
362 (void)fprintf(stderr, "\tar -s [-jz] archive\n");
363 (void)fprintf(stderr, "\tar -t [-Tv] archive [file ...]\n");
364 (void)fprintf(stderr, "\tar -x [-CTouv] archive [file ...]\n");
365 (void)fprintf(stderr, "\tar -V\n");
366 exit(EX_USAGE);
367}
368
369static void
353{
354
355 (void)fprintf(stderr, "usage: ar -d [-Tjsvz] archive file ...\n");
356 (void)fprintf(stderr, "\tar -m [-Tjsvz] archive file ...\n");
357 (void)fprintf(stderr, "\tar -m [-Tabijsvz] position archive file ...\n");
358 (void)fprintf(stderr, "\tar -p [-Tv] archive [file ...]\n");
359 (void)fprintf(stderr, "\tar -q [-Tcjsvz] archive file ...\n");
360 (void)fprintf(stderr, "\tar -r [-Tcjsuvz] archive file ...\n");
361 (void)fprintf(stderr, "\tar -r [-Tabcijsuvz] position archive file ...\n");
362 (void)fprintf(stderr, "\tar -s [-jz] archive\n");
363 (void)fprintf(stderr, "\tar -t [-Tv] archive [file ...]\n");
364 (void)fprintf(stderr, "\tar -x [-CTouv] archive [file ...]\n");
365 (void)fprintf(stderr, "\tar -V\n");
366 exit(EX_USAGE);
367}
368
369static void
370ranlib_usage()
370ranlib_usage(void)
371{
372
373 (void)fprintf(stderr, "usage: ranlib [-t] archive ...\n");
374 (void)fprintf(stderr, "\tranlib -V\n");
375 exit(EX_USAGE);
376}
377
378static void
371{
372
373 (void)fprintf(stderr, "usage: ranlib [-t] archive ...\n");
374 (void)fprintf(stderr, "\tranlib -V\n");
375 exit(EX_USAGE);
376}
377
378static void
379bsdar_version()
379bsdar_version(void)
380{
381 (void)printf("BSD ar %s - %s\n", BSDAR_VERSION, archive_version());
382 exit(EX_OK);
383}
384
385static void
380{
381 (void)printf("BSD ar %s - %s\n", BSDAR_VERSION, archive_version());
382 exit(EX_OK);
383}
384
385static void
386ranlib_version()
386ranlib_version(void)
387{
388 (void)printf("ranlib %s - %s\n", BSDAR_VERSION, archive_version());
389 exit(EX_OK);
390}
387{
388 (void)printf("ranlib %s - %s\n", BSDAR_VERSION, archive_version());
389 exit(EX_OK);
390}