Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
kamaki
Commits
0ec19fd3
Commit
0ec19fd3
authored
Jun 25, 2013
by
Stavros Sachtouris
Browse files
Restore history-run functionality
parent
a0608786
Changes
2
Hide whitespace changes
Inline
Side-by-side
kamaki/cli/command_shell.py
View file @
0ec19fd3
...
...
@@ -199,13 +199,12 @@ class Shell(Cmd):
ldescr
=
getattr
(
cls
,
'long_description'
,
''
)
if
subcmd
.
path
==
'history_run'
:
instance
=
cls
(
dict
(
cmd_parser
.
arguments
),
dict
(
cmd_parser
.
arguments
),
self
.
auth_base
,
cmd_tree
=
self
.
cmd_tree
)
else
:
instance
=
cls
(
dict
(
cmd_parser
.
arguments
),
self
.
auth_base
,
self
.
cloud
)
self
.
auth_base
,
self
.
cloud
)
cmd_parser
.
update_arguments
(
instance
.
arguments
)
cmd_parser
.
arguments
=
instance
.
arguments
cmd_parser
.
syntax
=
'%s %s'
%
(
...
...
@@ -223,9 +222,7 @@ class Shell(Cmd):
for
name
,
arg
in
instance
.
arguments
.
items
():
arg
.
value
=
getattr
(
cmd_parser
.
parsed
,
name
,
arg
.
default
)
cmd_parser
.
parsed
,
name
,
arg
.
default
)
exec_cmd
(
instance
,
cmd_parser
.
unparsed
,
help_method
)
#[term for term in cmd_parser.unparsed\
...
...
@@ -283,9 +280,7 @@ class Shell(Cmd):
empty
,
sep
,
subname
=
subcmd
.
path
.
partition
(
cmd
.
path
)
cmd_name
=
'%s %s'
%
(
cmd
.
name
,
subname
.
replace
(
'_'
,
' '
))
print
(
'
\n
%s
\n
Syntax:
\t
%s %s'
%
(
cls
.
description
,
cmd_name
,
cls
.
syntax
))
cls
.
description
,
cmd_name
,
cls
.
syntax
))
cmd_args
=
{}
for
arg
in
instance
.
arguments
.
values
():
cmd_args
[
','
.
join
(
arg
.
parsed_name
)]
=
arg
.
help
...
...
kamaki/cli/commands/history.py
View file @
0ec19fd3
...
...
@@ -161,7 +161,7 @@ class history_run(_init_history):
_cmd_tree
=
None
def
__init__
(
self
,
arguments
=
{},
auth_base
=
None
,
cmd_tree
=
None
):
super
(
self
.
__class__
,
self
).
__init__
(
arguments
)
super
(
self
.
__class__
,
self
).
__init__
(
arguments
,
auth_base
=
auth_base
)
self
.
_cmd_tree
=
cmd_tree
@
errors
.
generic
.
all
...
...
@@ -171,7 +171,9 @@ class history_run(_init_history):
if
not
cmd
.
is_command
:
return
try
:
instance
=
cmd
.
get_class
()(
self
.
arguments
)
instance
=
cmd
.
get_class
()(
self
.
arguments
,
auth_base
=
getattr
(
self
,
'auth_base'
,
None
))
instance
.
config
=
self
.
config
prs
=
ArgumentParseManager
(
cmd
.
path
.
split
(),
...
...
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