Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
962ba9ae
Commit
962ba9ae
authored
Dec 12, 2012
by
Davis King
Browse files
Added a discussion of the parser's set_group_name() method.
parent
251266dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
examples/compress_stream_ex.cpp
examples/compress_stream_ex.cpp
+12
-3
No files found.
examples/compress_stream_ex.cpp
View file @
962ba9ae
...
@@ -13,13 +13,16 @@
...
@@ -13,13 +13,16 @@
Options:
Options:
-c Indicates that we want to compress a file.
-c Indicates that we want to compress a file.
-d Indicates that we want to decompress a file.
-d Indicates that we want to decompress a file.
-h Display this help message.
--in <arg> This option takes one argument which specifies the name of the
--in <arg> This option takes one argument which specifies the name of the
file we want to compress/decompress.
file we want to compress/decompress.
-l <arg> Set the compression level [1-3], 3 is max compression, default
is 2.
--out <arg> This option takes one argument which specifies the name of the
--out <arg> This option takes one argument which specifies the name of the
output file.
output file.
Miscellaneous Options:
-h Display this help message.
-l <arg> Set the compression level [1-3], 3 is max compression, default
is 2.
*/
*/
...
@@ -55,6 +58,12 @@ int main(int argc, char** argv)
...
@@ -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
);
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
// 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
);
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
(
"h"
,
"Display this help message."
);
parser
.
add_option
(
"l"
,
"Set the compression level [1-3], 3 is max compression, default is 2."
,
1
);
parser
.
add_option
(
"l"
,
"Set the compression level [1-3], 3 is max compression, default is 2."
,
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment