mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
bracket syntax
This commit is contained in:
parent
5c269bc662
commit
c8ba400730
1 changed files with 6 additions and 11 deletions
17
mccli.py
17
mccli.py
|
|
@ -546,27 +546,22 @@ async def next_cmd(mc, cmds):
|
|||
case "send" :
|
||||
argnum = 2
|
||||
print(await mc.send_msg(bytes.fromhex(cmds[1]), cmds[2]))
|
||||
case "sendto" : # sends to a contact from name
|
||||
case "msg" | "sendto" | "m"|"(" : # sends to a contact from name
|
||||
argnum = 2
|
||||
await mc.ensure_contacts()
|
||||
print(await mc.send_msg(bytes.fromhex(mc.contacts[cmds[1]]["public_key"])[0:6],
|
||||
cmds[2]))
|
||||
case "msg" | "m" : # sends to a contact from name
|
||||
argnum = 2
|
||||
await mc.ensure_contacts()
|
||||
print(await mc.send_msg(bytes.fromhex(mc.contacts[cmds[1]]["public_key"])[0:6],
|
||||
cmds[2]))
|
||||
case "cmd" | "c" :
|
||||
case "cmd" | "c" | "[" :
|
||||
argnum = 2
|
||||
await mc.ensure_contacts()
|
||||
print(await mc.send_cmd(bytes.fromhex(mc.contacts[cmds[1]]["public_key"])[0:6],
|
||||
cmds[2]))
|
||||
case "login" | "l" :
|
||||
case "login" | "l" | "{" :
|
||||
argnum = 2
|
||||
await mc.ensure_contacts()
|
||||
print(await mc.send_login(bytes.fromhex(mc.contacts[cmds[1]]["public_key"]),
|
||||
cmds[2]))
|
||||
case "wait_login" | "wl":
|
||||
case "wait_login" | "wl"|"}":
|
||||
print(await mc.wait_login())
|
||||
case "req_status" | "rs" :
|
||||
argnum = 1
|
||||
|
|
@ -601,11 +596,11 @@ async def next_cmd(mc, cmds):
|
|||
while res:
|
||||
res = await mc.get_msg()
|
||||
print (res)
|
||||
case "wait_msg" | "wm" :
|
||||
case "wait_msg" | "wm" |"]":
|
||||
await mc.wait_msg()
|
||||
res = await mc.get_msg()
|
||||
print (res)
|
||||
case "wait_ack" | "wa" :
|
||||
case "wait_ack" | "wa" |")":
|
||||
await mc.wait_ack()
|
||||
case "infos" | "i" :
|
||||
print(json.dumps(mc.self_info,indent=4))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue