Proton  1.1.1
Make porting easy from Python to C++11
getopt.hpp
1 #ifndef PROTON_GETOPT_H
2 #define PROTON_GETOPT_H
3 
4 #include <proton/vector.hpp>
5 #include <proton/string.hpp>
6 #include <proton/tuple.hpp>
7 #include <stdexcept>
8 
9 namespace proton{
10 
11 /** @addtogroup getopt
12  * @{
13  */
14 
15 /** like getopt in python.
16  * Note: the prototype above is wrong due to some bugs of doxygen,
17  * use the prototype in the function list (above the "detailed description" line).
18  * @param argc argc in main()
19  * @param argv argv in main()
20  * @param optstr the option string
21  * @param longopt the long option arrays
22  * @return ([(option, value)], [args])
23  * @throw std::invalid_argument
24  */
25 std::tuple<vector_<std::tuple<str, str> >, vector_<str> > getopt(
26  int argc, char* const argv[],
27  const str& optstr, const vector_<str>& longopt={});
28 
29 /**
30  * @example getopt.cpp
31  * @}
32  */
33 
34 } // ns proton
35 
36 #endif // PROTON_GETOPT_H