1 /* args.h - parse command-line args
5 Copyright 2001 University of Southern California
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
32 int force_removal_of_essential_packages;
33 int force_removal_of_dependent_packages;
37 int multiple_providers;
40 int nocheckfordirorfile;
44 char *offline_root_path;
45 char *offline_root_pre_script_cmd;
46 char *offline_root_post_script_cmd;
49 typedef struct args args_t;
51 #define ARGS_DEFAULT_CONF_FILE_DIR OPKGETCDIR"/opkg"
52 #define ARGS_DEFAULT_CONF_FILE_NAME "opkg.conf"
53 #define ARGS_DEFAULT_DEST NULL
54 #define ARGS_DEFAULT_FORCE_DEFAULTS 0
55 #define ARGS_DEFAULT_FORCE_MAINTAINER 0
56 #define ARGS_DEFAULT_FORCE_DEPENDS 0
57 #define ARGS_DEFAULT_FORCE_OVERWRITE 0
58 #define ARGS_DEFAULT_FORCE_DOWNGRADE 0
59 #define ARGS_DEFAULT_FORCE_REINSTALL 0
60 #define ARGS_DEFAULT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES 0
61 #define ARGS_DEFAULT_FORCE_REMOVAL_OF_DEPENDENT_PACKAGES 0
62 #define ARGS_DEFAULT_FORCE_SPACE 0
63 #define ARGS_DEFAULT_OFFLINE_ROOT NULL
64 #define ARGS_DEFAULT_OFFLINE_ROOT_PATH NULL
65 #define ARGS_DEFAULT_OFFLINE_ROOT_PRE_SCRIPT_CMD NULL
66 #define ARGS_DEFAULT_OFFLINE_ROOT_POST_SCRIPT_CMD NULL
67 #define ARGS_DEFAULT_NOACTION 0
68 #define ARGS_DEFAULT_NODEPS 0
69 #define ARGS_DEFAULT_VERBOSE_WGET 0
70 #define ARGS_DEFAULT_VERBOSITY 1
71 #define ARGS_DEFAULT_AUTOREMOVE 0
73 int args_init(args_t *args);
74 void args_deinit(args_t *args);
75 int args_parse(args_t *args, int argc, char *argv[]);
76 void args_usage(char *complaint);