mtkennerly / shawl

Windows service wrapper for arbitrary commands
MIT License
448 stars 15 forks source link

Add options for start service argument passing #6

Closed Enet4 closed 4 years ago

Enet4 commented 4 years ago

This adds the option --pass-start-args to shawl so that arguments given on service start can be passed into the managed executable.

So for example, we can create a new service like this:

shawl add --name myservice --pass-start-args -- C:\Path\to\file.exe

Now when starting the service like this:

sc start myservice extra

The argument extra is also passed to file.exe.

I believe that this is a useful feature to become available upstream (we'll likely be using it ourselves in our fork). Tests were written as well. Please let me know if there is something you'd like addressed or explained.

mtkennerly commented 4 years ago

Thanks, this is great! I didn't even realize that start arguments were a thing. I'll plan to make a new release this weekend with the addition (plus I might try to squeeze in some logging options if I can get to it).

mtkennerly commented 4 years ago

@Enet4, this is now available in v0.6.0, along with log rotation.