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

Function main

util/crossgcc/getopt.c:40–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38#include <unistd.h>
39
40int
41main(int argc, char **argv)
42{
43 int c;
44 int status = 0;
45
46 optind = 2; /* Past the program name and the option letters. */
47 while ((c = getopt(argc, argv, argv[1])) != -1)
48 switch (c) {
49 case '?':
50 status = 1; /* getopt routine gave message */
51 break;
52 default:
53 if (optarg != NULL)
54 printf(" -%c %s", c, optarg);
55 else
56 printf(" -%c", c);
57 break;
58 }
59 printf(" --");
60 for (; optind < argc; optind++)
61 printf(" %s", argv[optind]);
62 printf("\n");
63 return(status);
64}

Callers

nothing calls this directly

Calls 2

getoptFunction · 0.85
printfFunction · 0.85

Tested by

no test coverage detected