]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - spaceman/init.c
2 * Copyright (c) 2012 Red Hat, Inc
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
33 _("Usage: %s [-c cmd] file\n"),
54 if (index
>= filecount
)
56 file
= &filetable
[index
++];
64 if (!(ct
->flags
& CMD_FLAG_ONESHOT
))
75 xfs_fsop_geom_t geometry
= { 0 };
78 progname
= basename(argv
[0]);
79 setlocale(LC_ALL
, "");
80 bindtextdomain(PACKAGE
, LOCALEDIR
);
83 fs_table_initialise(0, NULL
, 0, NULL
);
84 while ((c
= getopt(argc
, argv
, "c:p:V")) != EOF
) {
87 add_user_command(optarg
);
93 printf(_("%s version %s\n"), progname
, VERSION
);
100 if (optind
!= argc
- 1)
103 if ((c
= openfile(argv
[optind
], &geometry
, &fsp
)) < 0)
105 if (!platform_test_xfs_fd(c
))
106 printf(_("Not an XFS filesystem!\n"));
107 if (addfile(argv
[optind
], c
, &geometry
, &fsp
) < 0)
111 add_command_iterator(init_args_command
);
112 add_check_command(init_check_command
);