alecthomas / kingpin

CONTRIBUTIONS ONLY: A Go (golang) command line and flag parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wishlist: release guesswidth as its own separate package

autarch opened this issue · comments

I've wanted to use the guesswidth package in a couple projects of my own. I don't want to have to depend on all of kingpin (and inherits its deps) just to do this, so I'm copying files around.

It'd be great to see this code released as its own Go package.

@alecthomas Would you be okay with me releasing this package and then making a PR for kingpin to use it?

Sure thing!

I did a bit more digging and I realized that the golang.org/x/crypto module already has a package at godoc.org/golang.org/x/crypto/ssh/terminal with a GetSize() func. It's not quite exactly the same, as it can actually return an error and it doesn't check the COLUMNS env var, but for my needs it was good enough.

I'm not sure that it makes sense to have kingpin also use that terminal package as well. But regardless, I'll close this particular issue.