cobra icon indicating copy to clipboard operation
cobra copied to clipboard

support for non-posix compliant flags

Open capsci opened this issue 2 years ago • 2 comments

Not all CLIs want to enforce POSIX standards

Can cobra provide a way to choose between pflag vs non-POSIX flag parser?

capsci avatar Jun 28 '22 15:06 capsci

IMO this would be unlikely to move forward but I'm not sure how others feel. Standards are good and I'd rather stick to them if the community seems generally receptive. It seems like most users are able to work within the constraints of the POSIX standard flags and so I dont know that going out of our way to support less standard parsers.

In addition, it seems that this would take a large amount of work since the library is repeatedly tied to pflag, its types/fields/etc.

Due to the large required work and low perceived value, I'd not advocate for this change. If you want to try and keep pushing this forward I think it would be more convincing if you could come up with a particularly valuable use-case and demonstrate the work to transition wouldn't be as widespread as I imagine it.

I'll leave this open for others to weigh in though.

johnSchnake avatar Jul 01 '22 14:07 johnSchnake

I agree with @johnSchnake on this. Furthermore, the Cobra project is already strained so it would be difficult to have to maintain support for other flag forms.

marckhouzam avatar Jul 01 '22 14:07 marckhouzam