github.com/alecthomas/kong@v0.9.1-0.20240410131203-2ab5733f1179/doc.go (about)

     1  // Package kong aims to support arbitrarily complex command-line structures with as little developer effort as possible.
     2  //
     3  // Here's an example:
     4  //
     5  //	shell rm [-f] [-r] <paths> ...
     6  //	shell ls [<paths> ...]
     7  //
     8  // This can be represented by the following command-line structure:
     9  //
    10  //	package main
    11  //
    12  //	import "github.com/alecthomas/kong"
    13  //
    14  //	var CLI struct {
    15  //	  Rm struct {
    16  //	    Force     bool `short:"f" help:"Force removal."`
    17  //	    Recursive bool `short:"r" help:"Recursively remove files."`
    18  //
    19  //	    Paths []string `arg help:"Paths to remove." type:"path"`
    20  //	  } `cmd help:"Remove files."`
    21  //
    22  //	  Ls struct {
    23  //	    Paths []string `arg optional help:"Paths to list." type:"path"`
    24  //	  } `cmd help:"List paths."`
    25  //	}
    26  //
    27  //	func main() {
    28  //	  kong.Parse(&CLI)
    29  //	}
    30  //
    31  // See https://github.com/alecthomas/kong for details.
    32  package kong