2
* Copyright (C) 2004,2005 Heinz Mauelshagen, Red Hat GmbH.
5
* See file LICENSE at the top of this source tree for license information.
9
* See commands.[ch] for the perform() function call abstraction below.
12
#include <dmraid/dmraid.h>
18
main(int argc, char **argv)
21
struct lib_context *lc;
23
/* Initialize library (creates a context to use it). */
24
if ((lc = libdmraid_init(argc, argv))) {
26
* Parse command line arguments and run 'early'
27
* functions for options which set library context
28
* variables (eg, --debug).
30
* Initialize locking afterwards, so that the
31
* '--ignorelocking' option can be recognized.
33
* If both are ok -> perform the required action.
35
ret = handle_args(lc, argc, &argv) &&
36
init_locking(lc) && perform(lc, argv);
38
/* Cleanup the library context. */
42
/* Set standard exit code. */
43
exit(ret ? EXIT_SUCCESS : EXIT_FAILURE);