Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
argparse
✓ github.com/akamensky/argparse
Parses command-line arguments with a required name flag.
package main
import (
"fmt"
"github.com/akamensky/argparse"
"os"
)
func main() {
parser := argparse.NewParser("example", "Example argparse usage")
name := parser.String("n", "name", &argparse.Options{Required: true, Help: "Your name"})
err := parser.Parse(os.Args)
if err != nil {
fmt.Println(parser.Usage(err))
return
}
fmt.Printf("Hello, %s!\n", *name)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.4.0latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.