teesloane / firn

Org Mode Static Site Generator
Eclipse Public License 1.0
324 stars 24 forks source link

Switch arg parsing to clap-derive #110

Closed tranzystorekk closed 2 years ago

tranzystorekk commented 2 years ago

Switches arg parsing from vanilla clap to clap-derive, which reduces boilerplate code (e.g. manual parsing of arg strings to useful types like port numbers, automatic handling of default values)

Major changes:

Minor changes:

tranzystorekk commented 2 years ago

The version, about and author parts of help output can also be automated to the values from the Cargo.toml, if it is desired, but I haven't enabled it yet

teesloane commented 2 years ago

I'm open to this change, it's nice. Some stuff is still broken, however:

If you can get those working (and please make sure to test locally to make sure they do work, since there are no tests yet), then I'll be happy to merge this.

tranzystorekk commented 2 years ago

Seems the glob crate can't handle the . in its patterns, I think the easiest solution is to revert to env::current_dir() after all 😅

EDIT: that also means that running sth like firn serve . never worked, would probably require canonicalizing the path.

teesloane commented 2 years ago

Nice - looks good to me. Thanks for contributing.