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
1f51db71
Commit
1f51db71
authored
14 years ago
by
Seblu
Browse files
Options
Downloads
Patches
Plain Diff
fix some usage displaying
parent
e3cd9651
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cccli/cli.py
+1
-1
1 addition, 1 deletion
cccli/cli.py
cccli/command/right.py
+7
-4
7 additions, 4 deletions
cccli/command/right.py
cccli/command/shell.py
+5
-2
5 additions, 2 deletions
cccli/command/shell.py
with
13 additions
and
7 deletions
cccli/cli.py
+
1
−
1
View file @
1f51db71
...
...
@@ -149,7 +149,7 @@ class Cli(object):
self
.
printer
.
error
(
"
Bad argument.
"
)
usage
=
self
.
commands
.
usage
(
argv
[
0
])
if
usage
!=
""
:
self
.
printer
.
out
(
"
usage: %s.
"
%
usage
)
self
.
printer
.
out
(
usage
)
except
cmdBadName
:
self
.
printer
.
error
(
"
No command: %s.
"
%
argv
[
0
])
except
cmdWarning
as
e
:
...
...
This diff is collapsed.
Click to expand it.
cccli/command/right.py
+
7
−
4
View file @
1f51db71
...
...
@@ -13,7 +13,7 @@ from cccli.command.command import Command
from
optparse
import
OptionParser
class
Command_rights
(
Command
):
'''
List account rights
(current by default)
'''
'''
List account rights
'''
def
__call__
(
self
,
argv
):
# Parse argline
...
...
@@ -49,7 +49,7 @@ class Command_rights(Command):
class
Command_addright
(
Command
):
'''
Add
/
edit a right
'''
'''
Add
or
edit a
ccount
right
'''
def
__call__
(
self
,
argv
):
if
len
(
argv
)
!=
5
:
...
...
@@ -60,11 +60,14 @@ class Command_addright(Command):
raise
cmdError
(
"
RPCError: %s
"
%
str
(
e
))
def
usage
(
self
):
return
"
Usage: addright <tql> <right tql> <method> <target>
"
return
'''
Usage: addright <account tql> <right tql> <method> <target>
<method> is the name of the rpc command to allow
<target> can be allow or deny
'''
class
Command_delright
(
Command
):
'''
Delete a right
'''
'''
Delete a
ccount
right
'''
def
__call__
(
self
,
argv
):
if
len
(
argv
)
!=
3
:
...
...
This diff is collapsed.
Click to expand it.
cccli/command/shell.py
+
5
−
2
View file @
1f51db71
...
...
@@ -14,6 +14,7 @@ class Command_quit(Command):
def
__call__
(
self
,
argv
):
raise
SystemExit
()
class
Command_version
(
Command
):
'''
Print cli version
'''
def
__call__
(
self
,
argv
):
...
...
@@ -52,8 +53,10 @@ class Command_help(Command):
elif
len
(
argv
)
==
2
:
if
argv
[
1
]
not
in
self
.
cli
.
commands
:
raise
cmdBadArgument
(
argv
[
1
])
self
.
printer
.
out
(
self
.
cli
.
commands
.
help
(
argv
[
1
]))
self
.
printer
.
out
(
self
.
cli
.
commands
.
usage
(
argv
[
1
]))
c
=
self
.
cli
.
commands
for
u
in
(
c
.
help
(
argv
[
1
]),
c
.
usage
(
argv
[
1
])):
if
u
!=
""
:
self
.
printer
.
out
(
u
)
else
:
raise
cmdBadArgument
()
...
...
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