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
d0eb1cf1
Commit
d0eb1cf1
authored
14 years ago
by
Seblu
Browse files
Options
Downloads
Patches
Plain Diff
improve tags command
parent
4b192844
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
cccli/command/tag.py
+10
-10
10 additions, 10 deletions
cccli/command/tag.py
with
10 additions
and
10 deletions
cccli/command/tag.py
+
10
−
10
View file @
d0eb1cf1
...
@@ -8,20 +8,23 @@ CloudControl tag releated commands
...
@@ -8,20 +8,23 @@ CloudControl tag releated commands
from
cccli.exception
import
*
from
cccli.exception
import
*
from
sjrpc.core.exceptions
import
*
from
sjrpc.core.exceptions
import
*
from
cccli.printer
import
Printer
,
color
from
cccli.printer
import
Printer
,
color
from
cccli.command.command
import
Command
from
cccli.command.command
import
Command
,
OptionCommand
from
optparse
import
OptionParser
from
optparse
import
OptionParser
class
Command_tags
(
Command
):
class
Command_tags
(
OptionCommand
):
'''
List static tags on an account (current by default)
'''
'''
List static tags on an account
'''
def
__init__
(
self
,
cli
,
argv0
):
OptionCommand
.
__init__
(
self
,
cli
,
argv0
)
self
.
option
.
set_usage
(
"
%prog [options] [tql]
"
)
self
.
option
.
add_option
(
"
--raw
"
,
action
=
"
store_true
"
,
dest
=
"
raw
"
,
help
=
"
Don
'
t append filter on request
"
)
def
__call__
(
self
,
argv
):
def
__call__
(
self
,
argv
):
# Parse argline
# Parse argline
try
:
try
:
oparser
=
OptionParser
(
prog
=
argv
[
0
])
(
options
,
args
)
=
self
.
option
.
parse_args
(
argv
[
1
:])
oparser
.
add_option
(
"
--raw
"
,
action
=
"
store_true
"
,
dest
=
"
raw
"
,
help
=
"
Don
'
t append filter on request
"
)
(
options
,
args
)
=
oparser
.
parse_args
(
argv
[
1
:])
except
SystemExit
:
except
SystemExit
:
return
return
# append current login if nothing asked
# append current login if nothing asked
...
@@ -43,9 +46,6 @@ class Command_tags(Command):
...
@@ -43,9 +46,6 @@ class Command_tags(Command):
tags
=
"
"
.
join
([
"
%s%s:%s%s
"
%
(
color
[
"
green
"
],
t
,
color
[
"
reset
"
],
v
)
for
(
t
,
v
)
in
o
.
items
()
])
tags
=
"
"
.
join
([
"
%s%s:%s%s
"
%
(
color
[
"
green
"
],
t
,
color
[
"
reset
"
],
v
)
for
(
t
,
v
)
in
o
.
items
()
])
self
.
printer
.
out
(
"
%sid:%s%s%s %s
"
%
(
color
[
"
green
"
],
color
[
"
yellow
"
],
id
,
color
[
"
reset
"
],
tags
))
self
.
printer
.
out
(
"
%sid:%s%s%s %s
"
%
(
color
[
"
green
"
],
color
[
"
yellow
"
],
id
,
color
[
"
reset
"
],
tags
))
def
usage
(
self
):
return
"
Usage: tags [--raw] [--help] [tql]
"
class
Command_addtag
(
Command
):
class
Command_addtag
(
Command
):
'''
Add/Modify a static tag on an account
'''
'''
Add/Modify a static tag on an account
'''
...
...
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