Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
clapp
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libclapp
clapp
Commits
e9a9170b
Commit
e9a9170b
authored
6 months ago
by
Martin Wölzer
Browse files
Options
Downloads
Patches
Plain Diff
examples/sub_parser_example.cpp: get rid of std::endl
parent
f403d537
No related branches found
No related tags found
1 merge request
!24
Create release v.0.6.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/sub_parser_example.cpp
+13
-8
13 additions, 8 deletions
examples/sub_parser_example.cpp
with
13 additions
and
8 deletions
examples/sub_parser_example.cpp
+
13
−
8
View file @
e9a9170b
...
...
@@ -132,14 +132,15 @@ class cli_parser_t : public clapp::parser::basic_main_parser_t {
clapp
::
value
::
found_func_t
::
ret_t
print_version_and_exit
(
const
std
::
string
&
/*option*/
)
{
std
::
cout
<<
clapp
::
build_info
::
build_info_string
<<
std
::
endl
;
std
::
cout
<<
clapp
::
build_info
::
build_info_string
<<
"
\n
"
;
return
clapp
::
value
::
exit_t
::
exit
(
EXIT_SUCCESS
);
}
clapp
::
value
::
found_func_t
::
ret_t
print_not_implemented_and_exit
(
const
std
::
string
&
option
)
{
std
::
cout
<<
"Option '"
<<
option
<<
"' currently not implemented: don't use it!"
<<
std
::
endl
;
<<
"' currently not implemented: don't use it!"
<<
"
\n
"
;
return
clapp
::
value
::
exit_t
::
exit
(
EXIT_FAILURE
);
}
...
...
@@ -217,23 +218,27 @@ int main(int argc, char *argv[]) {
}
if
(
parser
->
first
)
{
// if the first sub-parser is selected
std
::
cout
<<
"first parser active"
<<
std
::
endl
;
std
::
cout
<<
"first parser active"
<<
"
\n
"
;
process_first
(
parser
->
first
);
}
else
{
std
::
cout
<<
"first parser not active"
<<
std
::
endl
;
std
::
cout
<<
"first parser not active"
<<
"
\n
"
;
}
if
(
parser
->
second
)
{
// if the first sub-parser is selected
std
::
cout
<<
"second parser active"
<<
std
::
endl
;
std
::
cout
<<
"second parser active"
<<
"
\n
"
;
process_second
(
parser
->
second
);
}
else
{
std
::
cout
<<
"second parser not active"
<<
std
::
endl
;
std
::
cout
<<
"second parser not active"
<<
"
\n
"
;
}
}
catch
(
clapp
::
clapp_exception_t
&
e
)
{
std
::
cout
<<
"Caught ClaPP-Exception: "
<<
e
.
what
()
<<
std
::
endl
;
std
::
cout
<<
"Caught ClaPP-Exception: "
<<
e
.
what
()
<<
"
\n
"
;
return
EXIT_FAILURE
;
}
catch
(
std
::
exception
&
e
)
{
std
::
cout
<<
"Caught Exception: "
<<
e
.
what
()
<<
std
::
endl
;
std
::
cout
<<
"Caught Exception: "
<<
e
.
what
()
<<
"
\n
"
;
return
EXIT_FAILURE
;
}
return
EXIT_SUCCESS
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment