PaddiM8 / kalker

Scientific calculator with math syntax that supports user-defined variables and functions, complex numbers, and estimation of derivatives and integrals
https://kalker.xyz
MIT License
1.59k stars 70 forks source link

Consider using a more robust CLI arguments parser #12

Closed shilangyu closed 3 years ago

shilangyu commented 4 years ago

Currently when I run kalk help (out of habit) I get a weird error of Undefined variable: 'h'.. I think switching to a ready solution would greatly benefit future development.

Something like Clap requires minimal setup while providing a lot of great features (like generating shell completions which are hard to maintain by hand). This will add to compile time though so it is worth thinking about it.

I am willing to help with the transition.

PaddiM8 commented 4 years ago

I have been planning to do this eventually, but yeah I am a bit worried about compile times/binary size since the cli arguments are so simple. Clap is probably a good choice anyway though. I will look into it.

matematikaadit commented 4 years ago

If you're worried about compile times/binary size, there are a few alternatives.

Here are some comparisons taken from pico-args' README

null pico-args clap gumdrop structopt argh
Binary overhead 0KiB 18.6KiB 379.8KiB 21.9KiB 379.6KiB 17.1KiB
Build time 0.1s 0.5s 5.4s 7.7s 15.3s 6.0s
Number of dependencies 0 0 12 5 25 12
Tested version - 0.3.3 2.33.1 0.8.0 0.3.14 0.1.3

Links:

PaddiM8 commented 4 years ago

@matematikaadit Thank you for this!

PaddiM8 commented 3 years ago

Ended up going with seahorse!