Skip to content

Instantly share code, notes, and snippets.

@triffid
Created June 23, 2012 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save triffid/2978294 to your computer and use it in GitHub Desktop.
Save triffid/2978294 to your computer and use it in GitHub Desktop.
slic3r machine readable options
slic3r --help | perl -ne '/^\s+([A-Z].*?)\s+options.*?:$/ && do { if ($description) { print "\t\t$description\n"; $description = ""; } print "SECTION $1\n"; }; /^\s+((-\S,\s*)?--(\S+))(\s+(.*))/ && do { if ($description) { print "\t\t$description\n"; $description = ""; }; print "\tOPTION $3\n"; $description = " $5"; }; /^\s{24}(\S.*)/ && (length($description) != 0) && do { $description .= $1 }; END { print "\t\t$description\n"; }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment