]>
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
21 _("Usage: %s [-c cmd] file\n"),
42 if (index
>= filecount
)
44 file
= &filetable
[index
++];
52 if (!(ct
->flags
& CMD_FLAG_ONESHOT
))
63 xfs_fsop_geom_t geometry
= { 0 };
66 progname
= basename(argv
[0]);
67 setlocale(LC_ALL
, "");
68 bindtextdomain(PACKAGE
, LOCALEDIR
);
71 fs_table_initialise(0, NULL
, 0, NULL
);
72 while ((c
= getopt(argc
, argv
, "c:p:V")) != EOF
) {
75 add_user_command(optarg
);
81 printf(_("%s version %s\n"), progname
, VERSION
);
88 if (optind
!= argc
- 1)
91 if ((c
= openfile(argv
[optind
], &geometry
, &fsp
)) < 0)
93 if (!platform_test_xfs_fd(c
))
94 printf(_("Not an XFS filesystem!\n"));
95 if (addfile(argv
[optind
], c
, &geometry
, &fsp
) < 0)
99 add_command_iterator(init_args_command
);
100 add_check_command(init_check_command
);