Skip to content

Instantly share code, notes, and snippets.

@satojkovic
Created June 21, 2013 06:57
Show Gist options
  • Save satojkovic/5829381 to your computer and use it in GitHub Desktop.
Save satojkovic/5829381 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <unistd.h>
int main(int argc, char *argv[])
{
int result;
while((result = getopt(argc, argv, "ab:")) != -1) {
switch(result){
case 'a':
std::cout << 'a' << std::endl;
break;
case 'b':
std::cout << "b," << optarg << std::endl;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment