summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2016-12-09 17:02:30 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-13 22:47:31 +0000
commite6480af22a7a12c655efed14f8f1aea658f26b1c (patch)
treed6c0418643ce56749b3d1c84a6cdd85780e64caf /scripts
parent77606455df7d45fd014c3603e1cf1b24efd37695 (diff)
downloadopenembedded-core-e6480af22a7a12c655efed14f8f1aea658f26b1c.tar.gz
openembedded-core-e6480af22a7a12c655efed14f8f1aea658f26b1c.tar.bz2
openembedded-core-e6480af22a7a12c655efed14f8f1aea658f26b1c.zip
oepydevshell-internal.py: standardize usage output
Made usage output of oepydevshell-internal.py to look similar to the output of other oe scripts. [YOCTO #10751] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/oepydevshell-internal.py15
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):
old[3] = old[3] &~ termios.ECHO &~ termios.ICANON
termios.tcsetattr(fd, termios.TCSADRAIN, old)
-if len(sys.argv) != 3:
- print("Incorrect parameters")
- sys.exit(1)
+if len(sys.argv) != 3 or sys.argv[1] in ('-h', '--help'):
+ print('oepydevshell-internal.py: error: the following arguments are required: pty, pid\n'
+ 'Usage: oepydevshell-internal.py pty pid\n\n'
+ 'OpenEmbedded oepydevshell-internal.py - internal script called from meta/classes/devshell.bbclass\n\n'
+ 'arguments:\n'
+ ' pty pty device name\n'
+ ' pid parent process id\n\n'
+ 'options:\n'
+ ' -h, --help show this help message and exit\n')
+ sys.exit(2)
pty = open(sys.argv[1], "w+b", 0)
parent = int(sys.argv[2])
@@ -38,7 +45,7 @@ readline.parse_and_bind("tab: complete")
try:
readline.read_history_file(histfile)
except IOError:
- pass
+ pass
try: