As a point of "style" I'm wondering how any of you unix programmers out there handle command-line arguments in your program.
Especially, I want to know what approach is taken when a particular argument shouldn't execute the main body of the program (like displaying the program manual), here's what I typically do in that situation:
( written in semi-pseudo code ):
I've never dabbled in multi-threaded programs (in fact I don't have any idea how that works).Code:int main( int argc, char *argv[] ){ bool exec_prog = 1; if( manual-argument-is-found ){ display_manual(); exec_prog = 0; } if( exec_prog ){ // None of this will happen if specific argument was found } return 0; }
Are separate threads even applicable here?
Thoughts?