getopt (command-line options)
Në shqip: Opsionet e komandës me getopt
ShpjegimiSQ
getopt() i lexon opsionet si -v ose -o skedari nga argv, në mënyrën standarde të Unix-it. getopt_long() lejon edhe opsione të gjata si --ndihme.
EnglishEN
getopt() reads options like -v or -o file from argv, the standard Unix way. getopt_long() also allows long options like --help.
Si ta mendosh
Si menyja e restorantit me opsione të qarta.
Lexoje në anglisht
Like a restaurant menu with clear options.
Shembull kodic
int o;
while ((o = getopt(argc, argv, "vo:")) != -1)
if (o == 'v') verbose = 1;
else if (o == 'o') dalja = optarg;