errata-ai / vale

:pencil: A markup-aware linter for prose built with speed and extensibility in mind.
https://vale.sh
MIT License
4.52k stars 155 forks source link

`vale` commands are shown in random order #855

Closed abitrolly closed 4 months ago

abitrolly commented 5 months ago

Check for existing issues

Environment

vale 3.6.0

Describe the bug / provide steps to reproduce it

Each time vale --help is invoked, the commands are shown randomly.

It is because the command list is stored in unordered map

https://github.com/errata-ai/vale/blob/3b6c8db432b9181f2ab836e9c68552743f72d139/cmd/vale/command.go#L30-L39

Here is the playground that illustrates this https://go.dev/play/p/7k1NNMjYxuv

abitrolly commented 5 months ago

The fix is to use list of strings - https://go.dev/play/p/dukMpLM7EHU

abitrolly commented 4 months ago

@jdkato I like my solution in #856 more, because it gives control over argument order.