Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
biboumi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
88
Issues
88
List
Boards
Labels
Service Desk
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
louiz’
biboumi
Commits
f89361c3
Commit
f89361c3
authored
Jul 31, 2016
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide a --help option
fix
#3183
parent
47902953
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
src/main.cpp
src/main.cpp
+20
-0
No files found.
src/main.cpp
View file @
f89361c3
...
...
@@ -34,6 +34,12 @@ int config_help(const std::string& missing_option)
return
1
;
}
int
display_help
()
{
std
::
cout
<<
"Usage: biboumi [configuration_file]"
<<
std
::
endl
;
return
0
;
}
static
void
sigint_handler
(
int
sig
,
siginfo_t
*
,
void
*
)
{
// In 2 seconds, repeat the same signal, to force the exit
...
...
@@ -49,6 +55,20 @@ static void sigusr_handler(int, siginfo_t*, void*)
int
main
(
int
ac
,
char
**
av
)
{
if
(
ac
>
1
)
{
const
std
::
string
arg
=
av
[
1
];
if
(
arg
.
size
()
>=
2
&&
arg
[
0
]
==
'-'
&&
arg
[
1
]
==
'-'
)
{
if
(
arg
==
"--help"
)
return
display_help
();
else
{
std
::
cerr
<<
"Unknow command line option: "
<<
arg
<<
std
::
endl
;
return
1
;
}
}
}
const
std
::
string
conf_filename
=
ac
>
1
?
av
[
1
]
:
xdg_config_path
(
"biboumi.cfg"
);
std
::
cout
<<
"Using configuration file: "
<<
conf_filename
<<
std
::
endl
;
...
...
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