Skip to content

**Terrible CLI Library** Both v2/v3 have serious bugs #2066

@System233

Description

@System233

The v3 version fails to properly recognize the -- terminator, making it completely unusable in my use case.
Related: #1114 (unresolved) ,#1562 (useless, insane patch) ...

The v2 version can handle the terminator correctly, but it cannot disable the comma-splitting behavior of StringSliceFlag, and cli.separatorSpec is not exported, making all features related to separatorSpec (like WithSeparatorSpec) unavailable.
Related: #1856 ,#1552 (should never happen) , #1878, #1541 ...

The above issues are just what I found, there are definitely more than these

These are all known issues, but they were closed without being fixed.

Additionally, there are weird functions like cli.Args().Slice(), Args().Tail(), etc., and I can only guess their functionality based on their output.

Since I couldn't resolve these issues, I switched to Cobra. I'm just posting this to vent.
Simply changing the command parsing part from urfave/cli to cobra, my binary size dropped from 12MB to 5MB, which is incredible.
Although Cobra’s API isn’t as pleasant to write as urfave/cli, at least it doesn’t have serious bugs and can handle basic command parsing.

Sorry for raising this issue, please feel free to close

Metadata

Metadata

Assignees

Labels

area/v2relates to / is being considered for v2area/v3relates to / is being considered for v3kind/questionsomeone asking a questionstatus/triagemaintainers still need to look into this

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions