diff options
-rwxr-xr-x | scripts/oepydevshell-internal.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/oepydevshell-internal.py b/scripts/oepydevshell-internal.py index a22bec3365..04621ae8a1 100755 --- a/scripts/oepydevshell-internal.py +++ b/scripts/oepydevshell-internal.py | |||
@@ -22,9 +22,16 @@ def cbreaknoecho(fd): | |||
22 | old[3] = old[3] &~ termios.ECHO &~ termios.ICANON | 22 | old[3] = old[3] &~ termios.ECHO &~ termios.ICANON |
23 | termios.tcsetattr(fd, termios.TCSADRAIN, old) | 23 | termios.tcsetattr(fd, termios.TCSADRAIN, old) |
24 | 24 | ||
25 | if len(sys.argv) != 3: | 25 | if len(sys.argv) != 3 or sys.argv[1] in ('-h', '--help'): |
26 | print("Incorrect parameters") | 26 | print('oepydevshell-internal.py: error: the following arguments are required: pty, pid\n' |
27 | sys.exit(1) | 27 | 'Usage: oepydevshell-internal.py pty pid\n\n' |
28 | 'OpenEmbedded oepydevshell-internal.py - internal script called from meta/classes/devshell.bbclass\n\n' | ||
29 | 'arguments:\n' | ||
30 | ' pty pty device name\n' | ||
31 | ' pid parent process id\n\n' | ||
32 | 'options:\n' | ||
33 | ' -h, --help show this help message and exit\n') | ||
34 | sys.exit(2) | ||
28 | 35 | ||
29 | pty = open(sys.argv[1], "w+b", 0) | 36 | pty = open(sys.argv[1], "w+b", 0) |
30 | parent = int(sys.argv[2]) | 37 | parent = int(sys.argv[2]) |
@@ -38,7 +45,7 @@ readline.parse_and_bind("tab: complete") | |||
38 | try: | 45 | try: |
39 | readline.read_history_file(histfile) | 46 | readline.read_history_file(histfile) |
40 | except IOError: | 47 | except IOError: |
41 | pass | 48 | pass |
42 | 49 | ||
43 | try: | 50 | try: |
44 | 51 | ||