Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sjrpc
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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
Mirror
sjrpc
Commits
ec708438
Commit
ec708438
authored
13 years ago
by
Seblu
Browse files
Options
Downloads
Patches
Plain Diff
Alias substitution is now handled in alias manager
parent
3e991997
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cccli/cli.py
+2
-4
2 additions, 4 deletions
cccli/cli.py
cccli/commands.py
+8
-0
8 additions, 0 deletions
cccli/commands.py
with
10 additions
and
4 deletions
cccli/cli.py
+
2
−
4
View file @
ec708438
...
...
@@ -112,10 +112,8 @@ class Cli(object):
if
len
(
argv
)
==
0
:
continue
# alias subsitution
if
argv
[
0
]
in
self
.
aliases
:
oldargv
=
argv
[
1
:]
argv
=
shlex
.
split
(
self
.
aliases
[
argv
[
0
]])
argv
.
extend
(
oldargv
)
argv
=
self
.
aliases
.
substitute
(
argv
)
# command execution
self
.
_exec_command
(
argv
)
except
KeyboardInterrupt
:
self
.
printer
.
out
(
""
)
...
...
This diff is collapsed.
Click to expand it.
cccli/commands.py
+
8
−
0
View file @
ec708438
...
...
@@ -7,6 +7,7 @@ CloudControl CLI commands module
import
re
import
ConfigParser
import
os
import
shlex
from
cccli.exception
import
*
from
cccli.command
import
*
...
...
@@ -98,3 +99,10 @@ class Aliases(dict):
for
n
,
v
in
self
.
items
():
fparser
.
set
(
"
alias
"
,
n
,
v
)
fparser
.
write
(
open
(
filename
,
"
w
"
))
def
substitute
(
self
,
argv
):
if
argv
[
0
]
in
self
:
oldargv
=
argv
[
1
:]
argv
=
shlex
.
split
(
self
[
argv
[
0
]])
argv
.
extend
(
oldargv
)
return
argv
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