getopt-like behavior in Go

前端 未结 9 704
南笙
南笙 2021-02-07 11:33

How do I nicely parse a list of program parameters and automate handling \"--help\" and/or \"--version\" (such as \"program [-d value] [--abc] [FILE1]\") in Go?

9条回答
  •  伪装坚强ぢ
    2021-02-07 11:58

    I think what you want is docopt. I'll just refer you to an earlier answer I posted for the details.

提交回复
热议问题