From: Eugene Crosser Date: Wed, 27 Apr 2022 12:45:47 +0000 (+0200) Subject: command line frontend accepts `key=value` args X-Git-Tag: 0.01~32 X-Git-Url: http://www.average.org/gitweb/?p=loctrkd.git;a=commitdiff_plain;h=74aee06447dd86bebef88c1172304b27740be835 command line frontend accepts `key=value` args Signed-off-by: Eugene Crosser --- diff --git a/gps303/__main__.py b/gps303/__main__.py index aa23427..38d21fe 100644 --- a/gps303/__main__.py +++ b/gps303/__main__.py @@ -26,7 +26,10 @@ def main(conf, opts, args): cls = class_by_prefix(cmd) if isinstance(cls, list): raise ValueError("Prefix does not select a single class: " + str(cls)) - kwargs = {} + kwargs = dict([arg.split("=") for arg in args]) + for arg in args: + k, v = arg.split("=") + kwargs[k] = v resp = Resp(imei=imei, packet=cls.Out(**kwargs).packed) log.debug("Response: %s", resp) zpush.send(resp.packed)