Skip to content

Instantly share code, notes, and snippets.

@NuckChorris
Created July 11, 2013 05:12
Show Gist options
  • Select an option

  • Save NuckChorris/5972683 to your computer and use it in GitHub Desktop.

Select an option

Save NuckChorris/5972683 to your computer and use it in GitHub Desktop.
#include "main.h"
//#include "utils.h"
//#include "acpi.h"
struct options {
char output[32][16],
char battery[]
};
int main
(int argc, char **argv)
{
int ch;
while ((ch = getopt_long(argc, argv, short_options, long_options, NULL)) != -1) {
switch (ch) {
case 'b':
printf("b=%s", optarg);
break;
case 'o':
printf("o=%s", optarg);
// options[1] = strtok_r();
// while (optarg[++i] != -1) {
// options[i] = `
// }
break;
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment