Skip to content

Commit

Permalink
Add usage for flag
Browse files Browse the repository at this point in the history
  • Loading branch information
lotusirous committed Dec 28, 2023
1 parent 5296493 commit 0ce6cb2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion stdsym/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"bufio"
"flag"
"fmt"
"log"
"os"
"regexp"
Expand All @@ -19,8 +20,16 @@ func main() {
}
}

func usage() {
fmt.Fprintf(os.Stderr, "usage: stdsym [options]\n")
fmt.Fprintf(os.Stderr, "Flags:\n")
flag.PrintDefaults()
os.Exit(2)
}

func run() error {
web := flag.Bool("web", false, "support web href")
web := flag.Bool("web", false, "enable pkgsite format with the '#' delimiter")
flag.Usage = usage
flag.Parse()
deli := "."
if *web {
Expand Down

0 comments on commit 0ce6cb2

Please sign in to comment.