File: main.go

package info (click to toggle)
golang-github-yuin-goldmark 1.7.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,692 kB
  • sloc: ansic: 76; makefile: 37
file content (45 lines) | stat: -rw-r--r-- 669 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package main

import (
	"fmt"
	"os"
)

func main() {

	var args []string
	cmd := "-h"
	if len(os.Args) > 1 {
		cmd = os.Args[1]
	}
	if len(os.Args) > 2 {
		args = os.Args[2:]
	}

	switch cmd {
	case "oss-fuzz-corpus":
		ossFuzzCorpusSubCommand(args)
	case "unicode-case-folding-map":
		unicodeCaseFoldingMapSubCommand(args)
	case "emb-structs":
		embStructsSubCommand(args)
	case "-h":
		fallthrough
	default:
		fmt.Fprintf(os.Stderr, `Usage: _tools <subcommand> [options]
subcommands:
  oss-fuzz-corpus
  unicode-case-folding-map
  emb-structs
`)
		os.Exit(1)
	}
}

func usage(u func(), err error) {
	u()
	if err != nil {
		fmt.Fprint(os.Stderr, err)
	}
	os.Exit(1)
}