You all know this feature:
int main(int argc, char* argv[]) { }
I want to write a Linux command line interface for my program, which is usually executed using getopt_long()
My program will be executed from the command line as follows:
pop3 get --limit 25 --recent
Therefore, argv[] will include pop3 as the name of its program, and the rest are treated as parameters. I want to remove pop3 from my string and set the first token after it as the first element of the array. Is there a way to do this other than a loop?
source share