yds12 / guarakapa

Password manager for the terminal.
MIT License
3 stars 1 forks source link

use command line parser #8

Open towhidzei opened 2 years ago

towhidzei commented 2 years ago

I recommend to use a command line parser. Something like clap or structopt if you agree, let me do that :))

yds12 commented 2 years ago

I was considering to use clap, but have been postponing it because so far the argument parsing is pretty simple. I made some tests here to see how much compilation time and binary size will increase with these libraries. I ran cargo build --release 4 times for each case and took an average, I got this:

current: 28.28s (compilation), 4.0MB (binary size) clap: 37.74s, 4.6MB structopt: 40.87s, 4.7MB

Both increase about 15% in binary size, but clap does better for compilation time with a 33% increase (vs 45% for structopt). That said, the program is pretty small so far so any new dependency makes a big impact. And, I think the argument parsing part is getting a bit messy, so if you would like to implement with clap I would be glad to merge it :)