File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -347,9 +347,18 @@ def _encode(self):
347347AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
348348AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA""" .encode ())
349349
350+ __usage = """Usage: gx.py COMMAND FILE
351+
352+ Where COMMAND can be:
353+ wrap will add a basic GX header to the provided GCODE and print the result to stdout.
354+ Example: ./gx.py wrap testdata/cube.gcode > /tmp/cube.gx
355+
356+ info will print info from the GX header.
357+ Example: ./gx.py info testdata/cube.gx"""
358+
350359if __name__ == "__main__" :
351360 import sys , traceback
352- cmd = sys .argv [1 ]
361+ cmd = sys .argv [1 ] if len ( sys . argv ) > 1 else ""
353362 if cmd == "wrap" :
354363 # Wraps the gcode file into a .gx one, output to stdout
355364 with open (sys .argv [2 ], 'rb' ) as fd :
@@ -383,5 +392,5 @@ def _encode(self):
383392 print ("Right extruder filament usage:" , g .filament_usage , 'mm' )
384393 print ("Left extruder filament usage:" , g .filament_usage_left , 'mm' )
385394 else :
386- print ("Unknown command " , cmd )
395+ print (__usage )
387396 sys .exit (1 )
You can’t perform that action at this time.
0 commit comments