MCPcopy Create free account
hub / github.com/coreutils/coreutils / main

Function main

src/runcon.c:113–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113int
114main (int argc, char **argv)
115{
116 char *role = NULL;
117 char *range = NULL;
118 char *user = NULL;
119 char *type = NULL;
120 char *context = NULL;
121 char *cur_context = NULL;
122 char *file_context = NULL;
123 char *new_context = NULL;
124 bool compute_trans = false;
125
126 context_t con;
127
128 initialize_main (&argc, &argv);
129 set_program_name (argv[0]);
130 setlocale (LC_ALL, "");
131 bindtextdomain (PACKAGE, LOCALEDIR);
132 textdomain (PACKAGE);
133
134 initialize_exit_failure (EXIT_CANCELED);
135 atexit (close_stdout);
136
137 while (true)
138 {
139 int option_index = 0;
140 int c = getopt_long (argc, argv, "+r:t:u:l:c", long_options,
141 &option_index);
142 if (c == -1)
143 break;
144 switch (c)
145 {
146 case 'r':
147 if (role)
148 error (EXIT_CANCELED, 0, _("multiple roles"));
149 role = optarg;
150 break;
151 case 't':
152 if (type)
153 error (EXIT_CANCELED, 0, _("multiple types"));
154 type = optarg;
155 break;
156 case 'u':
157 if (user)
158 error (EXIT_CANCELED, 0, _("multiple users"));
159 user = optarg;
160 break;
161 case 'l':
162 if (range)
163 error (EXIT_CANCELED, 0, _("multiple levelranges"));
164 range = optarg;
165 break;
166 case 'c':
167 compute_trans = true;
168 break;
169
170 case_GETOPT_HELP_CHAR;

Callers

nothing calls this directly

Calls 2

initialize_exit_failureFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected