mirror of
https://github.com/spl0k/supysonic.git
synced 2024-11-10 04:02:17 +00:00
parent
3e845f2f81
commit
9dd7d8a58b
@ -10,6 +10,8 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import cmd
|
import cmd
|
||||||
import getpass
|
import getpass
|
||||||
|
import pipes # replace by shlex once Python 2.7 supprt is dropped
|
||||||
|
import shlex
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@ -55,7 +57,7 @@ class SupysonicCLI(cmd.Cmd):
|
|||||||
def _make_do(self, command):
|
def _make_do(self, command):
|
||||||
def method(obj, line):
|
def method(obj, line):
|
||||||
try:
|
try:
|
||||||
args = getattr(obj, command + "_parser").parse_args(line.split())
|
args = getattr(obj, command + "_parser").parse_args(shlex.split(line))
|
||||||
except RuntimeError as e:
|
except RuntimeError as e:
|
||||||
self.write_error_line(str(e))
|
self.write_error_line(str(e))
|
||||||
return
|
return
|
||||||
@ -405,7 +407,7 @@ def main():
|
|||||||
|
|
||||||
cli = SupysonicCLI(config)
|
cli = SupysonicCLI(config)
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
cli.onecmd(" ".join(sys.argv[1:]))
|
cli.onecmd(" ".join(pipes.quote(arg) for arg in sys.argv[1:]))
|
||||||
else:
|
else:
|
||||||
cli.cmdloop()
|
cli.cmdloop()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user