Skip to content

Commit 2bcf15d

Browse files
committed
Add eprint and error mesages
1 parent 5963e53 commit 2bcf15d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

piduck.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
import argparse
33
from importlib import import_module
44
from time import sleep
5+
import sys
6+
7+
8+
def eprint(*args, **kwargs):
9+
print(*args, file=sys.stderr, **kwargs)
510

611

712
def string(string):
@@ -61,6 +66,7 @@ def pharse(line, known, deltrue):
6166
pharse(keymap.aliasmap[command[0]] + " " + " ".join(command[1:]), known, True)
6267
return
6368
else:
69+
eprint('Could not find "' + command[0] + '"')
6470
exit(2)
6571

6672

@@ -125,6 +131,7 @@ def main():
125131
try:
126132
keymap = import_module("pd_key_maps.keymap_" + key_layout)
127133
except ModuleNotFoundError:
134+
eprint('Keymap "' + key_layout + '" could not be found')
128135
exit(3)
129136
main()
130137
exit(0)

0 commit comments

Comments
 (0)