]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - spaceman/init.c
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2012 Red Hat, Inc
8 #include "libfrog/fsgeom.h"
12 #include "libfrog/paths.h"
22 _("Usage: %s [-c cmd] file\n"),
44 if (index
>= filecount
)
46 file
= &filetable
[index
++];
54 if (!(ct
->flags
& CMD_FLAG_ONESHOT
))
65 struct xfs_fd xfd
= XFS_FD_INIT_EMPTY
;
68 progname
= basename(argv
[0]);
69 setlocale(LC_ALL
, "");
70 bindtextdomain(PACKAGE
, LOCALEDIR
);
73 fs_table_initialise(0, NULL
, 0, NULL
);
74 while ((c
= getopt(argc
, argv
, "c:p:V")) != EOF
) {
77 add_user_command(optarg
);
83 printf(_("%s version %s\n"), progname
, VERSION
);
90 if (optind
!= argc
- 1)
93 c
= openfile(argv
[optind
], &xfd
, &fsp
);
96 if (!platform_test_xfs_fd(xfd
.fd
))
97 printf(_("Not an XFS filesystem!\n"));
98 c
= addfile(argv
[optind
], &xfd
, &fsp
);
103 add_command_iterator(init_args_command
);
104 add_check_command(init_check_command
);