Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
isaak yansane-sisk
slapos.buildout
Commits
0980e375
Commit
0980e375
authored
Mar 03, 2013
by
Jim Fulton
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #62 from mgedmin/buildout--version
Add bin/buildout --version
parents
8c13789c
72cceb15
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+13
-0
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+9
-0
No files found.
src/zc/buildout/buildout.py
View file @
0980e375
...
@@ -1601,6 +1601,10 @@ Options:
...
@@ -1601,6 +1601,10 @@ Options:
Print this message and exit.
Print this message and exit.
--version
Print buildout version number and exit.
-v
-v
Increase the level of verbosity. This option can be used multiple times.
Increase the level of verbosity. This option can be used multiple times.
...
@@ -1706,10 +1710,17 @@ Commands:
...
@@ -1706,10 +1710,17 @@ Commands:
COMPUTED_VALUE, DEFAULT_VALUE, COMMAND_LINE_VALUE).
COMPUTED_VALUE, DEFAULT_VALUE, COMMAND_LINE_VALUE).
"""
"""
def
_help
():
def
_help
():
print_
(
_usage
)
print_
(
_usage
)
sys
.
exit
(
0
)
sys
.
exit
(
0
)
def
_version
():
version
=
pkg_resources
.
working_set
.
find
(
pkg_resources
.
Requirement
.
parse
(
'zc.buildout'
)).
version
print_
(
"buildout version %s"
%
version
)
sys
.
exit
(
0
)
def
main
(
args
=
None
):
def
main
(
args
=
None
):
if
args
is
None
:
if
args
is
None
:
args
=
sys
.
argv
[
1
:]
args
=
sys
.
argv
[
1
:]
...
@@ -1772,6 +1783,8 @@ def main(args=None):
...
@@ -1772,6 +1783,8 @@ def main(args=None):
elif
op
:
elif
op
:
if
orig_op
==
'--help'
:
if
orig_op
==
'--help'
:
_help
()
_help
()
elif
orig_op
==
'--version'
:
_version
()
_error
(
"Invalid option"
,
'-'
+
op
[
0
])
_error
(
"Invalid option"
,
'-'
+
op
[
0
])
elif
'='
in
args
[
0
]:
elif
'='
in
args
[
0
]:
option
,
value
=
args
.
pop
(
0
).
split
(
'='
,
1
)
option
,
value
=
args
.
pop
(
0
).
split
(
'='
,
1
)
...
...
src/zc/buildout/tests.py
View file @
0980e375
...
@@ -595,6 +595,15 @@ def test_help():
...
@@ -595,6 +595,15 @@ def test_help():
...
...
"""
"""
def
test_version
():
"""
>>> buildout = os.path.join(sample_buildout, 'bin', 'buildout')
>>> print_(system(buildout+' --version'))
... # doctest: +ELLIPSIS
buildout version ...
"""
def
test_bootstrap_with_extension
():
def
test_bootstrap_with_extension
():
"""
"""
We had a problem running a bootstrap with an extension. Let's make
We had a problem running a bootstrap with an extension. Let's make
...
...
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