urfave / cli

A simple, fast, and fun package for building command line apps in Go
https://cli.urfave.org
MIT License
22.22k stars 1.7k forks source link

bug report: `cli.CommandsByName` not exist in v3-alpha4 #1816

Closed Passer6y closed 10 months ago

Passer6y commented 1 year ago

Checklist

What problem does this solve?

I want to following code to sort cli command, it works in v2, but not exist in v3-alpha4

sort.Sort(cli.CommandsByName(cli.Commands))

Solution description

Describe alternatives you've considered

dearchap commented 11 months ago

@Passer6y You can do

rootCommand := Command{...}
sort.Sort(rootCommand.Commands)