KillingSpark / rustysd

A service manager that is able to run "traditional" systemd services, written in rust
MIT License
500 stars 15 forks source link

Use pico-args for arg parsing #31

Closed MggMuggins closed 4 years ago

MggMuggins commented 4 years ago

I'm not sure if this is really much better than it was before, it would be handy for the parse_args func to do all the validation and pass back a consistent error type with a possibility for some other errors wrapped up in some of the variants.

I ran the tests (not sure if they use the arg parsing or not :D), and tested with a couple of arg combos and it seems to work.

Regardless of caveats, feel free to merge or close this PR, pico-args is just one option for arg-parsing. This code could also use improvement, I'm happy to incorporate feedback.

KillingSpark commented 4 years ago

Thanks! Not having to worry about tedious arg parsing for future options is quite helpful :)

KillingSpark commented 4 years ago

I think the error variants is not too important right now. It would of course be nice but it's just polishing.

MggMuggins commented 4 years ago

Yeah, that's what I figured. Do ping me if it ever gets to a point when that would be required.