kantlivelong / OctoPrint-GCodeSystemCommands

Define G-Code commands that execute local system commands.
GNU Affero General Public License v3.0
37 stars 20 forks source link

Added ability to specify optional parameters for the custom GCode tha… #10

Closed aplocher closed 4 years ago

aplocher commented 6 years ago

…t will be passed to the shell command

New pull request against the devel branch. Also removed shell=true from the subprocess call so it won't allow these new args to be used for injecting additional commands (could be a breaking change if someone is already utilizing that, but I think that's a relatively low risk).

maurobertorotta commented 4 years ago

Hello !

Can you help me about your pull-request GCodeSystemCommands about the ability to specify optional parameters ?

I have undestand that is possible to send a command like OCTO100 50 (for example to send a number to Pan) but in Command Definition of OCTO100 how I can catch the parameter value ?

I have try with : uvcdynctrl -s 'Pan (relative)' %s ... but don't go ...

Sorry for the silly question but I am not a super-guru with this kind of syntax ... ;-)

kantlivelong commented 4 years ago

So this is now in 1.0.0 but not the same as this PR. Arguments are passed to commands as environment variables. If you are calling a binary directly you will need to write a wrapper to parse the arguments safely.

kantlivelong commented 4 years ago

@justinmbrock Provide more details in a new ticket. Though the update brought in support for passing args to GCode commands (IE OCTO999 arg1 arg2). It shouldn't change anything with using arguments with system commands.

justinmbrock commented 4 years ago

I just deleted it haha. I was mistaken. It didn't break anything I already had working. Thank you for the plugin!