Coder Social home page Coder Social logo

sflags's Issues

Multiple build issues

I'm trying to build fdbe18c before starting to contribute, but:

1. make fails

$ make
Go generate
Formatting
Run vet
Run lint
Run metalinter
parser_test.go:28:3:warning: field name6 is unused (U1000) (megacheck)
make: *** [check] Error 1

I'm using the latest gometalinter and I have ensured that the linters are up-to-date (gometalinter -i -u)

2. go test fails

--- FAIL: TestValidator (0.00s)
        Error Trace:    parser_test.go:414
	Error:      	Invalid operation: (sflags.ValidateFunc)(nil) == (sflags.ValidateFunc)(nil) (cannot take func type as argument)
	Test:       	TestValidator
FAIL
exit status 1
FAIL	github.com/octago/sflags	0.025s

I'm using the latest version of the assert package: go get -u github.com/stretchr/testify/assert

Add support for cobra

Cobra is already supported by pflags, but some things, like environment variables, might be implemented only for cobra.

ast flagset parser to generate sflags structs

Hi,

Hope you are all well !

I am using amalgomate, a go tool for combining multiple different main packages into a single program or library, and I would like to export flags from repacked packages and wrap them with your package, so I can get more details info while printing the help of the repacked package. (Feature actually missing in the current amalgomate version)

Is there a tool allowing to convert a flagset from a package by parsing the ast in order to insert a sflags structs and import your package ?

It could be done here:
https://github.com/palantir/amalgomate/blob/master/amalgomate/astfuncs.go#L121-L133

Thanks for any insights.

Cheers,
Rosco

New project heavily piggy-backing on your repository

Hello !
I'm posting a little message to "advertise" a project I've been working for a long time now, which is a merging of your own work and the concepts of https://github.com/jessevdk/go-flags, which brings a new array of possiblities and functionality to generated CLI tools.
Since your project was an immense help, because it helped me shifting my approach when working on go-flags, and that most of your code is still used in this new library, I wanted to make a heads-up here !
Link to the repo: https://github.com/reeflective/flags

Hope you will find it useful !

go mod path

module declares its path as: github.com/sflags
but was required as: github.com/octago/sflags

go mod tidy fails

Suggestion: there should be separate dividers for hierarchies and multi-word options within the same hierarchy

For example

type Multi struct {
	Word Word
}

type Word struct {
	String string
}

type Config struct {
	Multi     *Multi
	MultiWord *Word
}

This sort of config results in both of those options being turned into the flag multi-word-string . This causes some issues when sflags is used in combination with config file parsing libraries because it's impossible to automatically determine if multi-word-string is multi.word.string or multi-word.string.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.