Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Illuna-Minetest
illuna-minetest
Commits
5dce44ec
Commit
5dce44ec
authored
11 years ago
by
Kahrl
Browse files
Options
Downloads
Patches
Plain Diff
Add --version option
parent
f0edd88d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/minetest.6
+3
-0
3 additions, 0 deletions
doc/minetest.6
doc/minetestserver.6
+3
-0
3 additions, 0 deletions
doc/minetestserver.6
src/main.cpp
+14
-0
14 additions, 0 deletions
src/main.cpp
with
20 additions
and
0 deletions
doc/minetest.6
+
3
−
0
View file @
5dce44ec
...
...
@@ -37,6 +37,9 @@ Disable main menu
\-\-help
Show allowed options
.TP
\-\-version
Show version information
.TP
\-\-logfile <value>
Set logfile path (debug.txt)
.TP
...
...
This diff is collapsed.
Click to expand it.
doc/minetestserver.6
+
3
−
0
View file @
5dce44ec
...
...
@@ -31,6 +31,9 @@ Set gameid
\-\-help
Show allowed options
.TP
\-\-version
Show version information
.TP
\-\-logfile <value>
Set logfile path (debug.txt)
.TP
...
...
This diff is collapsed.
Click to expand it.
src/main.cpp
+
14
−
0
View file @
5dce44ec
...
...
@@ -772,6 +772,8 @@ int main(int argc, char *argv[])
std
::
map
<
std
::
string
,
ValueSpec
>
allowed_options
;
allowed_options
.
insert
(
std
::
make_pair
(
"help"
,
ValueSpec
(
VALUETYPE_FLAG
,
_
(
"Show allowed options"
))));
allowed_options
.
insert
(
std
::
make_pair
(
"version"
,
ValueSpec
(
VALUETYPE_FLAG
,
_
(
"Show version information"
))));
allowed_options
.
insert
(
std
::
make_pair
(
"config"
,
ValueSpec
(
VALUETYPE_STRING
,
_
(
"Load configuration from specified file"
))));
allowed_options
.
insert
(
std
::
make_pair
(
"port"
,
ValueSpec
(
VALUETYPE_STRING
,
...
...
@@ -843,6 +845,18 @@ int main(int argc, char *argv[])
return
cmd_args
.
getFlag
(
"help"
)
?
0
:
1
;
}
if
(
cmd_args
.
getFlag
(
"version"
))
{
#ifdef SERVER
dstream
<<
"minetestserver "
<<
minetest_version_hash
<<
std
::
endl
;
#else
dstream
<<
"Minetest "
<<
minetest_version_hash
<<
std
::
endl
;
dstream
<<
"Using Irrlicht "
<<
IRRLICHT_SDK_VERSION
<<
std
::
endl
;
#endif
dstream
<<
"Build info: "
<<
minetest_build_info
<<
std
::
endl
;
return
0
;
}
/*
Low-level initialization
...
...
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