by knuckle_cake · 16y ago · 0 comments
I'm actually developing a console-based ruby app right now. What would have been useful for me however is something to easily work with a REPL (including commands, subcommands, etc.) without a) having to drop into a full IRB session b) any assumptions that I want to parse an ARGV-like line with --long-switches and whatnot. I don't.
cmdparse is the closest, but still isn't good enough.
Thanks for doing the work on your project. Open-source authors don't get thanked often enough if their project isn't used by millions.
I had been actually thinking on the lines of how emacs can expose its commands -- although i am not an emacs user. I'd need to study that.
I am very familiar with various command line parsing libraries, including cmdparse. I did not get your requirement in this context. Thanks for answering.
I was wanting for something that lets me add commands, with aliasing, and arguments (maybe with optional regex validation) - e.g. breakpoint add $BEEF, etc. Writing a DSL is one solution and will probably end up being the way I go once I take a second iteration at this. Right now I'm just using regex parsing, but I only have a few commands I need to worry about now.
cmdparse is frustratingly close but makes a few assumptions that you want to parse ARGV or something that looks like it.
The current implementation is that I have a hardware instance (like a CPU) that I want to monitor. To do that, I create a new monitor object, and tell it to monitor the hardware instance, and the monitor will mix itself in from there. It's not good if extra methods show up in the global namespace just for command parsing within a single module of the app. The monitor is just a part of this application, and a part that will not be used often by most users.
Everything I see feels like it's inches from what I really need. So close yet so far :)