My favorites | Sign in
Project Logo
             
Details: Show all Hide all

Older

  • Oct 31, 2009
    BasicUsage (GetOpt_pp Basic Usage) Wiki page commented on by danielgutson   -   Hmm, I should document this. There are two ways: 1) using e vector<T> http://code.google.com/p/getoptpp/source/browse/trunk/example_general1.cpp 2) using an iterator: http://code.google.com/p/getoptpp/source/browse/trunk/example_iterators.cpp
  • Oct 31, 2009
    BasicUsage (GetOpt_pp Basic Usage) Wiki page commented on by cesar.romero   -   how do i access all the arguments from either of the options in the example? whenever I try something like -p 1 2 3 I get a TooManyArgumentsEx
    how do i access all the arguments from either of the options in the example? whenever I try something like -p 1 2 3 I get a TooManyArgumentsEx
  • Oct 28, 2009
    Introduction (GetOpt_pp intro.) Wiki page commented on by rnaveos   -   getopt_pp.h, applied following patch to avoid a compilation warning 111c111 < : short_opt(other.short_opt), long_opt(other.long_opt), target(other.target) --- > : _Option( other ), short_opt(other.short_opt), long_opt(other.long_opt), target(other.target)
    getopt_pp.h, applied following patch to avoid a compilation warning 111c111 < : short_opt(other.short_opt), long_opt(other.long_opt), target(other.target) --- > : _Option( other ), short_opt(other.short_opt), long_opt(other.long_opt), target(other.target)
  • Oct 15, 2009
    issue 19 (mingw compilation problem) reported by jinserk.baik   -   What steps will reproduce the problem? 1. "getopt_pp_standalone.h" included 2. 3. What is the expected output? What do you see instead? I've got this message In file included from ../include/getoptpp/getopt_pp_standalone.h:26, from ../src/main.cpp:17: ../include/getoptpp/getopt_pp.cpp: In member function `void GetOpt::GetOpt_pp::_parse_env()': ../include/getoptpp/getopt_pp.cpp:94: error: `environ' was not declared in this scope make: *** [../src/main.o] Error 1 I think that your code includes the environ related code only works on Mac. What version of the product are you using? On what operating system? Windows, MinGW, gcc 3.4.5 Please provide any additional information below. Temporarily, I deleted #ifdef __APPLE__ and #endif to declare environ all the time. then I can compile it. However, I think that you'd better to use main(int argc, char* argv[], char* envp[]) and GETOPT_INLINE void _parse(int argc, char* argv[], char* envp[]) to get the environment parameters.
    What steps will reproduce the problem? 1. "getopt_pp_standalone.h" included 2. 3. What is the expected output? What do you see instead? I've got this message In file included from ../include/getoptpp/getopt_pp_standalone.h:26, from ../src/main.cpp:17: ../include/getoptpp/getopt_pp.cpp: In member function `void GetOpt::GetOpt_pp::_parse_env()': ../include/getoptpp/getopt_pp.cpp:94: error: `environ' was not declared in this scope make: *** [../src/main.o] Error 1 I think that your code includes the environ related code only works on Mac. What version of the product are you using? On what operating system? Windows, MinGW, gcc 3.4.5 Please provide any additional information below. Temporarily, I deleted #ifdef __APPLE__ and #endif to declare environ all the time. then I can compile it. However, I think that you'd better to use main(int argc, char* argv[], char* envp[]) and GETOPT_INLINE void _parse(int argc, char* argv[], char* envp[]) to get the environment parameters.
  • Aug 11, 2009
    issue 18 (Does not work when other commandline arguments are present) commented on by alokkw   -   Let me make it clear. Consider the command line: ./program --option 10 Argument Here, --option = 10 and The program has one more command line ARGUMENT (not OPTION) What I expect is : The variable "options" gets value 10. And the argument remains as it is. However, the library fails to achieve the first task. i.e. options gets a garbage value DESPITE an explicit value being provided. AS I SAID, this problem is present ONLY WHEN there are command line arguments in addition to options.
    Let me make it clear. Consider the command line: ./program --option 10 Argument Here, --option = 10 and The program has one more command line ARGUMENT (not OPTION) What I expect is : The variable "options" gets value 10. And the argument remains as it is. However, the library fails to achieve the first task. i.e. options gets a garbage value DESPITE an explicit value being provided. AS I SAID, this problem is present ONLY WHEN there are command line arguments in addition to options.
  • Aug 10, 2009
    issue 18 (Does not work when other commandline arguments are present) Status changed by danielgutson   -   Alok, sorry, I don't understand what the issue is. According to the documentation, the behavior is what's expected: if you don't provide the option, the library actually DOESN'T overwrite the variable (it has garbage because it wasn't initialized). You may want one of the following alternatives: 1) initialize the variable with a sensible value. 2) provide a default value 3) test if the manipulator succeeded 4) ask the library to throw an exception. I will only post here an example of the option 3: int main(int argc, char ** argv) { GetOpt_pp options(argc, argv); int q; if (options >> Option('q', "query", q)) cerr<<"Q "<<q<<endl; else cerr<<"-q not present" << endl; } If you don't provide a value in the command line, the second message is shown. Please let me know if this solves your question. Thanks, Daniel.
    Status: WontFix
    Alok, sorry, I don't understand what the issue is. According to the documentation, the behavior is what's expected: if you don't provide the option, the library actually DOESN'T overwrite the variable (it has garbage because it wasn't initialized). You may want one of the following alternatives: 1) initialize the variable with a sensible value. 2) provide a default value 3) test if the manipulator succeeded 4) ask the library to throw an exception. I will only post here an example of the option 3: int main(int argc, char ** argv) { GetOpt_pp options(argc, argv); int q; if (options >> Option('q', "query", q)) cerr<<"Q "<<q<<endl; else cerr<<"-q not present" << endl; } If you don't provide a value in the command line, the second message is shown. Please let me know if this solves your question. Thanks, Daniel.
    Status: WontFix
  • Jul 27, 2009
    issue 18 (Does not work when other commandline arguments are present) commented on by danielgutson   -   Hmm, it's a too basic example for it not to work... Thanks, I'll see it tonight.
    Hmm, it's a too basic example for it not to work... Thanks, I'll see it tonight.
  • Jul 27, 2009
    issue 18 (Does not work when other commandline arguments are present) commented on by alokkw   -   Here is a very small code that reproduces it. Run it with and without argument to reproduce the problem. #include <iostream> #include <getopt_pp.h> using namespace std; using namespace GetOpt; int main(int argc, char ** argv) { GetOpt_pp options(argc, argv); int q; options >> Option('q', "query", q); cerr<<"Q "<<q<<endl; }
    Here is a very small code that reproduces it. Run it with and without argument to reproduce the problem. #include <iostream> #include <getopt_pp.h> using namespace std; using namespace GetOpt; int main(int argc, char ** argv) { GetOpt_pp options(argc, argv); int q; options >> Option('q', "query", q); cerr<<"Q "<<q<<endl; }
  • Jul 27, 2009
    issue 18 (Does not work when other commandline arguments are present) commented on by alokkw   -   I tried with int... Alok
    I tried with int... Alok
  • Jul 27, 2009
    issue 18 (Does not work when other commandline arguments are present) commented on by danielgutson   -   Could you please specify what type myVar is? Thanks again, Daniel.
    Could you please specify what type myVar is? Thanks again, Daniel.
  • Jul 27, 2009
    issue 18 (Does not work when other commandline arguments are present) commented on by danielgutson   -   Hi, thanks for the bug report. I'll analyze this tonight. Daniel.
    Hi, thanks for the bug report. I'll analyze this tonight. Daniel.
  • Jul 27, 2009
    issue 18 (Does not work when other commandline arguments are present) reported by alokkw   -   What steps will reproduce the problem? 1. Run the program with an option as well as an argument e.g. ./program --option 10 Argument What is the expected output? What do you see instead? Program assigns garbage to the option :-( Ideally, The option should be "consumed" by GetOpt an argv should have only the command line argument. i.e. argv before using manipulator "Option" ["program", "--option", "10", "Argument"] argv after Option('o', "option", myVar) should be ["program", "Argument"] I am using the latest version on Linux box
    What steps will reproduce the problem? 1. Run the program with an option as well as an argument e.g. ./program --option 10 Argument What is the expected output? What do you see instead? Program assigns garbage to the option :-( Ideally, The option should be "consumed" by GetOpt an argv should have only the command line argument. i.e. argv before using manipulator "Option" ["program", "--option", "10", "Argument"] argv after Option('o', "option", myVar) should be ["program", "Argument"] I am using the latest version on Linux box
  • May 22, 2009
    issue 17 (Add a makefile to make a library and installer) reported by danielgutson   -   make make install
    make make install
  • Oct 26, 2008
    Introduction (GetOpt_pp intro.) Wiki page edited by danielgutson
  • Aug 28, 2008
    issue 16 (Use getopt_pp under Macos X darwin) Status changed by danielgutson   -   Done. Thanks!
    Status: Fixed
    Done. Thanks!
    Status: Fixed
  • Aug 28, 2008
    Acknowledgments (Thanks) Wiki page edited by danielgutson
  • Aug 28, 2008
    r114 (Version 1.2) committed by danielgutson   -   Version 1.2
    Version 1.2
  • Aug 05, 2008
    issue 16 (Use getopt_pp under Macos X darwin) commented on by danielgutson   -   Thanks again Jerome. I'll add this during the weekend. Daniel.
    Thanks again Jerome. I'll add this during the weekend. Daniel.
  • Jul 31, 2008
    issue 16 (Use getopt_pp under Macos X darwin) commented on by jeromelesaux   -   No, you included unistd.h. It's juste because environ variable is declared in /usr/include/unistd.h (under linux) and not in Macos X. It's just a particularity of Macos X ;).
    No, you included unistd.h. It's juste because environ variable is declared in /usr/include/unistd.h (under linux) and not in Macos X. It's just a particularity of Macos X ;).
  • Jul 30, 2008
    issue 16 (Use getopt_pp under Macos X darwin) Status changed by danielgutson   -   Seems that I forgot to include unistd.h (I thought I did) Jerome, could you please add that include in getopt_pp.h and tell me if it compiles? Thanks! Daniel.
    Status: Accepted
    Seems that I forgot to include unistd.h (I thought I did) Jerome, could you please add that include in getopt_pp.h and tell me if it compiles? Thanks! Daniel.
    Status: Accepted
  • Jul 30, 2008
    issue 16 (Use getopt_pp under Macos X darwin) reported by jeromelesaux   -   What steps will reproduce the problem? 1. use Getopt_pp.cpp on Macos X Darwin What is the expected output? What do you see instead? To use getopt_pp under Macos X What version of the product are you using? On what operating system? the current version 2.12 Please provide any additional information below. To avoid the problem, add the following code just after headers of getopt_pp.cpp file: #if __APPLE__ extern char** environ; #endif Sincerely yours Jerome (jlesaux __at__ free __dot__ fr)
    What steps will reproduce the problem? 1. use Getopt_pp.cpp on Macos X Darwin What is the expected output? What do you see instead? To use getopt_pp under Macos X What version of the product are you using? On what operating system? the current version 2.12 Please provide any additional information below. To avoid the problem, add the following code just after headers of getopt_pp.cpp file: #if __APPLE__ extern char** environ; #endif Sincerely yours Jerome (jlesaux __at__ free __dot__ fr)
 
Hosted by Google Code