<FromGitter>
<naqvis> but such approach is quite fragile
<FromGitter>
<naqvis> also in your class you have restricted the types which `Options` array can hold, but `add` method isn't imposing any restriction, so it might break for cases where you call `add` with type which isn't part of your expected types.
<FromGitter>
<naqvis> https://play.crystal-lang.org/#/r/e7ul ⏎ ⏎ this snippet contains a macro check for `add` method and ensure only allowed types are allowed at compile time. So if you try invoking `add` method with Types which aren't part of `Type` alias, it will fail to compile.
<FromGitter>
<skinnyjames> Ah, thanks. ⏎ ⏎ > also in your class you have restricted the types which Options array can hold, but add method isn't imposing any restriction, so it might break for cases where you call add with type which isn't part of your expected types. ⏎ ⏎ Good call, I'd actually be fine without such restriction; just an array of OptionBuilder(T). I'd like to use the type to cast string values to (T), but
<FromGitter>
<skinnyjames> > are a few CLI shards out there if that would be easier than rolling your own ⏎ ⏎ Ah yeah, I did take a look. I'll take another glance now that I have a better idea of what I'd like to do.
<FromGitter>
<Blacksmoke16> looking for something in particular?
<FromGitter>
<skinnyjames> > looking for something in particular? ⏎ Was looking for something lightweight, extensible and up to date with latest Crystal. ⏎ ⏎ I was looking into Admiral and Commander, but I think I'm going to poke around the docs for Athena console. ⏎ I want to attach a CLI to a task runner (base/abstract class), but also be able to compose (sub)commands across implementations of the task runner.
<FromGitter>
<Blacksmoke16> 👍 sounds good. let me know if you have any questions about it.
<FromGitter>
<Blacksmoke16> most of the builders in that list mainly just focus on the arg/option parsing side of a CLI, athena's console component is more of a CLI framework in that it provides extra common utilities. Like for formatting/styling output, testing aids, creating tables, asking questions, etc
<FromGitter>
<Blacksmoke16> the one catch is it doesnt exactly support sub commands, but uses `:` as a way to group related commands. E.g. `admin:create-user` or `admin:sync-data`, etc
<FromGitter>
<skinnyjames> Nice, I'm a big fan of the TTY toolkit (https://ttytoolkit.org/) in ruby; haven't thought much about prompts etc.
<FromGitter>
<Blacksmoke16> the question type docs would have more details of how they work. Or ofc easy enough to just play around with it