Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos.core
Commits
d0d29df5
Commit
d0d29df5
authored
May 02, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print old message to stderr when a subcommand is not found, instead of
exception
parent
af66f9a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
slapos/cli/entry.py
slapos/cli/entry.py
+20
-1
No files found.
slapos/cli/entry.py
View file @
d0d29df5
...
@@ -11,13 +11,32 @@ import slapos.version
...
@@ -11,13 +11,32 @@ import slapos.version
class
SlapOSCommandManager
(
cliff
.
commandmanager
.
CommandManager
):
class
SlapOSCommandManager
(
cliff
.
commandmanager
.
CommandManager
):
def
find_command
(
self
,
argv
):
def
find_command
(
self
,
argv
):
"""Given an argument list, find a command and
return the processor and any remaining arguments.
"""
# XXX a little cheating, 'slapos node' is not documented
# XXX a little cheating, 'slapos node' is not documented
# by the help command
# by the help command
if
argv
==
[
'node'
]:
if
argv
==
[
'node'
]:
argv
=
[
'node'
,
'status'
]
argv
=
[
'node'
,
'status'
]
return
super
(
SlapOSCommandManager
,
self
).
find_command
(
argv
)
search_args
=
argv
[:]
name
=
''
while
search_args
:
if
search_args
[
0
].
startswith
(
'-'
):
raise
ValueError
(
'Invalid command %r'
%
search_args
[
0
])
next_val
=
search_args
.
pop
(
0
)
name
=
'%s %s'
%
(
name
,
next_val
)
if
name
else
next_val
if
name
in
self
.
commands
:
cmd_ep
=
self
.
commands
[
name
]
cmd_factory
=
cmd_ep
.
load
()
return
(
cmd_factory
,
name
,
search_args
)
else
:
print
>>
sys
.
stderr
,
(
'The command %r does not exist or is not yet implemented.
\
n
'
'Please have a look at http://community.slapos.org to read documentation or forum.
\
n
'
'Please also make sure that SlapOS Node is up to date.'
%
(
argv
,))
sys
.
exit
(
5
)
class
SlapOSApp
(
cliff
.
app
.
App
):
class
SlapOSApp
(
cliff
.
app
.
App
):
...
...
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