|
@_mfridman | |||||
|
Do you write CLIs in #golang?
If you need to reach for a framework, I'd suggest checking out..
github.com/peterbourgon/f…
- Simple API surface
- No global state
- Nice structural foundation for long term maintenance. Check out the objectctl example.
Great job @peterbourgon
|
||||||
|
||||||
|
ian molee
@ianfoo
|
1. velj |
|
I do, but still end up using no framework. Peter's commitment to reasoned simplicity resonates with me though so I really should look at this again, so thanks for the reminder.
|
||
|
|
||
|
Mike Fridman
@_mfridman
|
1. velj |
|
cool. I've used most other frameworks, but found them bulky and API surface way too large, i.e., tries to do too much.
on the flip side, at least for me, starting with a raw func main + a few flags + time ... the CLI grows and becomes hard to maintain as features grow.
|
||
|
|
||
|
Stephen Gutekanst
@slimsag
|
2. velj |
|
Very nice, this looks super similar to a ~100 line snippet I regularly copy into my projects called commander (even more minimal than a dependency) which uses the std `flag` package and supports nested nested CLIs mirroring the `go` command.
|
||
|
|
||
|
Stephen Gutekanst
@slimsag
|
2. velj |
|
I will probably publish this somewhere later with a better explanation, but we use it in the @srcgraph CLI here: github.com/sourcegraph/sr…
And an example of how it gets used: sourcegraph.com/github.com/sou…
|
||
|
|
||