Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
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
Container Registry
Model registry
Monitor
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
Maunium
synapse
Commits
e45b0564
Commit
e45b0564
authored
9 years ago
by
Mark Haines
Browse files
Options
Downloads
Patches
Plain Diff
Fix the --help option for synapse
parent
3d5a955e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/config/_base.py
+29
-18
29 additions, 18 deletions
synapse/config/_base.py
with
29 additions
and
18 deletions
synapse/config/_base.py
+
29
−
18
View file @
e45b0564
...
...
@@ -144,16 +144,17 @@ class Config(object):
)
config_args
,
remaining_args
=
config_parser
.
parse_known_args
(
argv
)
if
not
config_args
.
config_path
:
config_parser
.
error
(
"
Must supply a config file.
\n
A config file can be automatically
"
"
generated using
\"
--generate-config -h SERVER_NAME
"
"
-c CONFIG-FILE
\"
"
)
config_dir_path
=
os
.
path
.
dirname
(
config_args
.
config_path
[
0
])
config_dir_path
=
os
.
path
.
abspath
(
config_dir_path
)
if
config_args
.
generate_config
:
if
not
config_args
.
config_path
:
config_parser
.
error
(
"
Must supply a config file.
\n
A config file can be automatically
"
"
generated using
\"
--generate-config -h SERVER_NAME
"
"
-c CONFIG-FILE
\"
"
)
config_dir_path
=
os
.
path
.
dirname
(
config_args
.
config_path
[
0
])
config_dir_path
=
os
.
path
.
abspath
(
config_dir_path
)
server_name
=
config_args
.
server_name
if
not
server_name
:
print
"
Most specify a server_name to a generate config for.
"
...
...
@@ -196,6 +197,25 @@ class Config(object):
)
sys
.
exit
(
0
)
parser
=
argparse
.
ArgumentParser
(
parents
=
[
config_parser
],
description
=
description
,
formatter_class
=
argparse
.
RawDescriptionHelpFormatter
,
)
obj
.
invoke_all
(
"
add_arguments
"
,
parser
)
args
=
parser
.
parse_args
(
remaining_args
)
if
not
config_args
.
config_path
:
config_parser
.
error
(
"
Must supply a config file.
\n
A config file can be automatically
"
"
generated using
\"
--generate-config -h SERVER_NAME
"
"
-c CONFIG-FILE
\"
"
)
config_dir_path
=
os
.
path
.
dirname
(
config_args
.
config_path
[
0
])
config_dir_path
=
os
.
path
.
abspath
(
config_dir_path
)
specified_config
=
{}
for
config_path
in
config_args
.
config_path
:
yaml_config
=
cls
.
read_config_file
(
config_path
)
...
...
@@ -208,15 +228,6 @@ class Config(object):
obj
.
invoke_all
(
"
read_config
"
,
config
)
parser
=
argparse
.
ArgumentParser
(
parents
=
[
config_parser
],
description
=
description
,
formatter_class
=
argparse
.
RawDescriptionHelpFormatter
,
)
obj
.
invoke_all
(
"
add_arguments
"
,
parser
)
args
=
parser
.
parse_args
(
remaining_args
)
obj
.
invoke_all
(
"
read_arguments
"
,
args
)
return
obj
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