aerogear / charmil

The framework for building modular plugin based CLI's using Cobra and Golang
https://aerogear.github.io/charmil
Apache License 2.0
116 stars 13 forks source link

Validator Rule - Provide rule for validating flag name #224

Open wtrocki opened 3 years ago

wtrocki commented 3 years ago

For example format of the flag, the name should be camelcase, kebab case etc.

wtrocki commented 3 years ago

Examples of 2 different formats

cmd.Flags().StringVarP(&opts.outputFile, "outputFile", "", "", "Filename of the output file")
cmd.Flags().StringVarP(&opts.outputFile, "output-file", "", "", "Filename of the output file")
ankithans commented 3 years ago

can go into punctuation rule(not sure)

we can give option to choose from - camelcase, kebabcase, snakecase etc. for the whole CLI, they can choose whatever they prefer in the cli.

wtrocki commented 3 years ago

or regexp :)