dnf-json: read arguments as JSON from stdin
This allows us to have more expressive input arguments.
This commit is contained in:
parent
0feb4e4d44
commit
cae1fdd04d
2 changed files with 28 additions and 14 deletions
13
dnf-json
13
dnf-json
|
|
@ -11,16 +11,9 @@ def timestamp_to_rfc3339(timestamp):
|
|||
return d.strftime('%Y-%m-%dT%H:%M:%SZ')
|
||||
|
||||
|
||||
# base.sack.query().filter(provides=str(reldep))
|
||||
|
||||
|
||||
try:
|
||||
command = sys.argv[1]
|
||||
arguments = sys.argv[2:]
|
||||
except IndexError:
|
||||
command = "list"
|
||||
arguments = []
|
||||
|
||||
call = json.load(sys.stdin)
|
||||
command = call["command"]
|
||||
arguments = call.get("arguments", {})
|
||||
|
||||
base = dnf.Base()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue