/** @ingroup tutorials @defgroup tutorial_args Command line arguments @brief Parsing command-line arguments If you would like to pass command line arguments to your Player client programs you can use the getopt feature provided by unistd.h. \dontinclude args.h \skipline unistd You must supply a series of characters in optflags, which are the legitimate options to you program. If the characher is followed by a colon (:) then that option requires an additional parameter. These parameters are returned as const char* so you must use functions like atoi() or atof() if you would like numerical results. \skip parse_args \until end parse_args It is also often helpfull to include a short output function that explains the option parameters to your program. @verbatim USAGE: myprogram [options] Where [options] can be: -h : hostname to connect to (default: localhost) -p : port where Player will listen (default: 6665) -i : device index (default: 0) -d : debug message level (0 = none -- 9 = all) -u : set server update rate to in Hz -m : set server data delivery mode PLAYER_DATAMODE_PUSH_ALL = 0 PLAYER_DATAMODE_PULL_ALL = 1 PLAYER_DATAMODE_PUSH_NEW = 2 PLAYER_DATAMODE_PULL_NEW = 3 PLAYER_DATAMODE_ASYNC = 4 @endverbatim \skip print_usage \until end print_usage For the complete code see examples/libplayerc++/args.h */