Browse Source

Add url and exit code

fix
Laurent Kislaire 3 years ago
parent
commit
29fc3806d9
  1. 11
      pyfbx/__main__.py

11
pyfbx/__main__.py

@ -30,10 +30,13 @@ def main():
help="increase verbosity to INFO, use twice for DEBUG")
parser.add_argument("-n", "--http", action="store_true",
help="Disable MDNS and use http known address")
parser.add_argument("-u", "--url", type=str,
help="specific url to query",
default=None)
args = parser.parse_args()
console(log, log_level[min(2, args.verbose)])
try:
myfb = Fbx(nomdns=args.http)
myfb = Fbx(nomdns=args.http, url=args.url)
token = args.token
if token:
if token.startswith('f:'):
@ -47,5 +50,11 @@ def main():
myfb.mksession(app_id=args.app_id, token=token)
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(eval(f"myfb.{args.command}"))
return 0
except BaseException as err:
print(err)
return 2
if __name__ == "__main__":
exit(main())

Loading…
Cancel
Save