mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-17 00:07:37 +02:00
fix line clobbering bug and add user field to shortcuts
This commit is contained in:
@ -249,8 +249,10 @@ def parse(data, raw=False, quiet=False):
|
|||||||
if line.strip().startswith('@'):
|
if line.strip().startswith('@'):
|
||||||
shortcut_line = cleandata.pop(i)
|
shortcut_line = cleandata.pop(i)
|
||||||
occurrence = shortcut_line.split(maxsplit=1)[0].strip().lstrip('@')
|
occurrence = shortcut_line.split(maxsplit=1)[0].strip().lstrip('@')
|
||||||
cmd = shortcut_line.split(maxsplit=1)[1].strip()
|
usr = shortcut_line.split(maxsplit=2)[1].strip()
|
||||||
|
cmd = shortcut_line.split(maxsplit=2)[2].strip()
|
||||||
shortcut_list.append({'occurrence': occurrence,
|
shortcut_list.append({'occurrence': occurrence,
|
||||||
|
'user': usr,
|
||||||
'command': cmd})
|
'command': cmd})
|
||||||
|
|
||||||
# Add header row for parsing
|
# Add header row for parsing
|
||||||
|
Reference in New Issue
Block a user