Closed picatz closed 7 years ago
@picatz Any benefits from using trollop instead of GetoptLong?
@ring0lab I think there is a certain when clarity using trollop in some cases. In general, I believe it reads pretty decently. Perhaps I'd call it a bit more "ruby-like" in some ways, but that's just some opinion stuff that might be best to be ignored in favor of the clarity argument. But, that's also a bit subjective.
There's also some stuff you get for free while using trollop that I think is pretty handy. A usage menu, a pretty smart and easy to use API to describe the ( command-line ) interface. Other rubyists are generally pretty used to trollop. I think it simplifies a lot of stuff and is really easy to lean on to do some of the boring stuff for command-line parsers while doing it more than half-way decently with a few minor edge cases that are hardly a problem.
Granted, as I've hinted, it's far from perfect. It's just very simple to implement.
Also. One could argue that a better solution could be to just follow suite with many applications such as bettercap and just use require 'optparse'
which is "much more advanced, yet also easier to use, than GetoptLong, and is a more Ruby-oriented solution."[*]
Honestly, while writing this. That might just be the best solution. I'd give it a quick looksie.
If using trollop
or optparse
make it more annoying for you to work on the code base ( or anyone else that would want to chime in for or against ), then I don't really mind using the longest of opts that I have to get to get the job done to make things go as smooth as possible. 👍
Structural Overhaul for Even More 🌞 and 🌈s
I made some changes that I think help modularize the codebase a little more and can allow for easier testing of the individual parts of the application ( which I haven't added ).
➡️ This is what I did.
I also detail some of the changes further in the commit details, but, I probably should've just broken them up into smaller commits for that branch. Oh well.
Small Confession & Thought
There's also some comments left in there that I will clean up in a little bit after posting this. Probably could even add some more documentation comments in yardoc style or something. Because that way it'll look better when it's published as a gem to rubygems.
Speaking of that...
💎 Let's Gemify Catphish
There's plenty of tutorials online for how to do this.
Solving the Dependency Issues
Because some people have had problems with the other gems this application relies on not being on their system -- we should just manage that for them by bundling it up as a pretty gem.
The dependency specifications can be laid out simply in the catphish application gempsec ( which doesn't exist yet ) and that can be taken care of much simpler. And then hopefully that issue doesn't happen for anyone else -- like myself 😺 -- ever again.
🌈 Rainbow Option
I haven't added this yet. But, that'll be super easy to add.