Skip to content

Commit f4671ff

Browse files
committed
handle multiline msg
1 parent 49ee83b commit f4671ff

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "meshcore-cli"
7-
version = "1.1.36"
7+
version = "1.1.37"
88
authors = [
99
{ name="Florent de Lamotte", email="[email protected]" },
1010
]

src/meshcore_cli/meshcore_cli.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from meshcore import MeshCore, EventType, logger
2424

2525
# Version
26-
VERSION = "v1.1.36"
26+
VERSION = "v1.1.37"
2727

2828
# default ble address is stored in a config file
2929
MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/"
@@ -69,7 +69,7 @@ def escape_ansi(line):
6969
ansi_escape = re.compile(r'(?:\x1B[@-_]|[\x80-\x9F])[0-?]*[ -/]*[@-~]')
7070
return ansi_escape.sub('', line)
7171

72-
def print_above(str):
72+
def print_one_line_above(str):
7373
""" prints a string above current line """
7474
width = os.get_terminal_size().columns
7575
stringlen = len(escape_ansi(str))-1
@@ -85,6 +85,11 @@ def print_above(str):
8585
print(str, end="") # Print output status msg
8686
print("\u001B[u", end="", flush=True) # Jump back to saved cursor position
8787

88+
def print_above(str):
89+
lines = str.split('\n')
90+
for l in lines:
91+
print_one_line_above(l)
92+
8893
async def process_event_message(mc, ev, json_output, end="\n", above=False):
8994
""" display incoming message """
9095
if ev is None :
@@ -350,6 +355,7 @@ def make_completion_dict(contacts, pending={}, to=None, channels=None):
350355
"share_contact" : contact_list,
351356
"path": contact_list,
352357
"disc_path" : contact_list,
358+
"trace" : None,
353359
"reset_path" : contact_list,
354360
"change_path" : contact_list,
355361
"change_flags" : contact_list,
@@ -2399,6 +2405,7 @@ def command_help():
23992405
import_contact <URI> : import a contact from its URI ic
24002406
remove_contact <ct> : removes a contact from this node
24012407
path <ct> : diplays path for a contact
2408+
disc_path <ct> : discover new path and display dp
24022409
reset_path <ct> : resets path to a contact to flood rp
24032410
change_path <ct> <pth> : change the path to a contact cp
24042411
change_flags <ct> <f> : change contact flags (tel_l|tel_a|star)cf
@@ -2407,13 +2414,14 @@ def command_help():
24072414
req_acl <ct> : requests access control list for sensor
24082415
pending_contacts : show pending contacts
24092416
add_pending <key> : manually add pending contact from key
2410-
flush_pending : flush pending contact clist
2417+
flush_pending : flush pending contact list
24112418
Repeaters
24122419
login <name> <pwd> : log into a node (rep) with given pwd l
24132420
logout <name> : log out of a repeater
24142421
cmd <name> <cmd> : sends a command to a repeater (no ack) c [
24152422
wmt8 : wait for a msg (reply) with a timeout ]
2416-
req_status <name> : requests status from a node rs""")
2423+
req_status <name> : requests status from a node rs
2424+
trace <path> : run a trace, path is comma separated""")
24172425

24182426
def usage () :
24192427
""" Prints some help """

0 commit comments

Comments
 (0)