Skip to content

Commit

Permalink
docs: added help usage to GXwriter/gx.py
Browse files Browse the repository at this point in the history
Refs #16
  • Loading branch information
ronoaldo committed Aug 17, 2022
1 parent 3c41710 commit abd556b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plugins/GXWriter/gx.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,18 @@ def _encode(self):
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA""".encode())

__usage="""Usage: gx.py COMMAND FILE
Where COMMAND can be:
wrap will add a basic GX header to the provided GCODE and print the result to stdout.
Example: ./gx.py wrap testdata/cube.gcode > /tmp/cube.gx
info will print info from the GX header.
Example: ./gx.py info testdata/cube.gx"""

if __name__ == "__main__":
import sys, traceback
cmd = sys.argv[1]
cmd = sys.argv[1] if len(sys.argv)>1 else ""
if cmd == "wrap":
# Wraps the gcode file into a .gx one, output to stdout
with open(sys.argv[2], 'rb') as fd:
Expand Down Expand Up @@ -383,5 +392,5 @@ def _encode(self):
print("Right extruder filament usage:", g.filament_usage, 'mm')
print("Left extruder filament usage:", g.filament_usage_left, 'mm')
else:
print("Unknown command ", cmd)
print(__usage)
sys.exit(1)

0 comments on commit abd556b

Please sign in to comment.