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

Function main

src/realpath.c:193–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193int
194main (int argc, char **argv)
195{
196 bool ok = true;
197 int can_mode = CAN_ALL_BUT_LAST;
198 char const *relative_to = NULL;
199 char const *relative_base = NULL;
200
201 initialize_main (&argc, &argv);
202 set_program_name (argv[0]);
203 setlocale (LC_ALL, "");
204 bindtextdomain (PACKAGE, LOCALEDIR);
205 textdomain (PACKAGE);
206
207 atexit (close_stdout);
208
209 while (true)
210 {
211 int c = getopt_long (argc, argv, "EeLmPqsz", longopts, NULL);
212 if (c == -1)
213 break;
214 switch (c)
215 {
216 case 'E':
217 can_mode &= ~CAN_MODE_MASK;
218 can_mode |= CAN_ALL_BUT_LAST;
219 break;
220 case 'e':
221 can_mode &= ~CAN_MODE_MASK;
222 can_mode |= CAN_EXISTING;
223 break;
224 case 'm':
225 can_mode &= ~CAN_MODE_MASK;
226 can_mode |= CAN_MISSING;
227 break;
228 case 'L':
229 can_mode |= CAN_NOLINKS;
230 logical = true;
231 break;
232 case 's':
233 can_mode |= CAN_NOLINKS;
234 logical = false;
235 break;
236 case 'P':
237 can_mode &= ~CAN_NOLINKS;
238 logical = false;
239 break;
240 case 'q':
241 verbose = false;
242 break;
243 case 'z':
244 use_nuls = true;
245 break;
246 case RELATIVE_TO_OPTION:
247 relative_to = optarg;
248 break;
249 case RELATIVE_BASE_OPTION:
250 relative_base = optarg;

Callers

nothing calls this directly

Calls 5

realpath_canonFunction · 0.85
isdirFunction · 0.85
path_prefixFunction · 0.85
process_pathFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected