From 962ba9ae944c92b5667ff25691bcbe0cf60b7ccb Mon Sep 17 00:00:00 2001 From: Davis King Date: Wed, 12 Dec 2012 21:01:05 -0500 Subject: [PATCH] Added a discussion of the parser's set_group_name() method. --- examples/compress_stream_ex.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/compress_stream_ex.cpp b/examples/compress_stream_ex.cpp index 455624e32..502400e5e 100644 --- a/examples/compress_stream_ex.cpp +++ b/examples/compress_stream_ex.cpp @@ -13,13 +13,16 @@ Options: -c Indicates that we want to compress a file. -d Indicates that we want to decompress a file. - -h Display this help message. --in This option takes one argument which specifies the name of the file we want to compress/decompress. - -l Set the compression level [1-3], 3 is max compression, default - is 2. --out This option takes one argument which specifies the name of the output file. + + Miscellaneous Options: + -h Display this help message. + -l Set the compression level [1-3], 3 is max compression, default + is 2. + */ @@ -55,6 +58,12 @@ int main(int argc, char** argv) parser.add_option("in","This option takes one argument which specifies the name of the file we want to compress/decompress.",1); // add a --out option that takes 1 argument parser.add_option("out","This option takes one argument which specifies the name of the output file.",1); + // In the code below, we use the parser.print_options() method to print all our + // options to the screen. We can tell it that we would like some options to be + // grouped together by calling set_group_name() before adding those options. In + // general, you can make as many groups as you like by calling set_group_name(). + // However, here we make only one named group. + parser.set_group_name("Miscellaneous Options"); parser.add_option("h","Display this help message."); parser.add_option("l","Set the compression level [1-3], 3 is max compression, default is 2.",1);