KnightSch / python-on-a-chip

Automatically exported from code.google.com/p/python-on-a-chip
Other
0 stars 1 forks source link

ipm provides poor command-line diagnostics #199

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Running ipm on Windows from the command line:

C:\Users\bjones\Documents\svns\python-on-a-chip>src\tools\ipm.py
Traceback (most recent call last):
  File "C:\Users\bjones\Documents\svns\python-on-a-chip\src\tools\ipm.py", line
412, in <module>
    main()
  File "C:\Users\bjones\Documents\svns\python-on-a-chip\src\tools\ipm.py", line
375, in main
    conn, pmfeatures_filename = parse_cmdline()
  File "C:\Users\bjones\Documents\svns\python-on-a-chip\src\tools\ipm.py", line
361, in parse_cmdline
    raise Exception("Must give the path to the pmfeatures.py file using -f.")
Exception: Must give the path to the pmfeatures.py file using -f.

Second pass:
C:\Users\bjones\Documents\svns\python-on-a-chip>src\tools\ipm.py -f src\platform
\windows\pmfeatures.py
Traceback (most recent call last):
  File "C:\Users\bjones\Documents\svns\python-on-a-chip\src\tools\ipm.py", line
412, in <module>
    main()
  File "C:\Users\bjones\Documents\svns\python-on-a-chip\src\tools\ipm.py", line
375, in main
    conn, pmfeatures_filename = parse_cmdline()
  File "C:\Users\bjones\Documents\svns\python-on-a-chip\src\tools\ipm.py", line
365, in parse_cmdline
    raise Exception("Must specify a desktop or serial connection.")
Exception: Must specify a desktop or serial connection.

I'd suggest printing this output instead of throwing an exception:
C:\Users\bjones\Documents\svns\python-on-a-chip>src\tools\ipm.py -help
Usage: ipm.py -f PMFEATURES [options]

Options:
  -h, --help            show this help message and exit
  -d, --desktop         connect to VM running on the desktop via OS pipes
  -s SERDEV, --serial=SERDEV
                        connect to VM over a serial device
  -b BAUD, --baud=BAUD  baudrate (bps) (default = 19200)
  -f PMFEATURES         path to the platform's pmfeatures.py file (REQUIRED)

Original issue reported on code.google.com by bjones460@gmail.com on 3 May 2011 at 3:37

GoogleCodeExporter commented 8 years ago
I used parser.error() to print the short usage and the error message and then 
exit.

Original comment by dwhall...@gmail.com on 7 May 2011 at 11:05

GoogleCodeExporter commented 8 years ago
This issue was closed by revision a38ae803b999.

Original comment by dwhall...@gmail.com on 7 May 2011 at 11:07

GoogleCodeExporter commented 8 years ago

Original comment by dwhall...@gmail.com on 15 May 2011 at 8:15