-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.go
41 lines (32 loc) · 724 Bytes
/
main.go
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
package main
import (
"flag"
"go/build"
"log"
"os"
)
// /home/alex/workspace/docker-cli/opts/opts_windows.go
const (
pwd = "./"
)
func init() {
build.Default.UseAllFiles = true
}
func usage() {
log.Printf("Usage of %s:\n", os.Args[0])
log.Printf("\ncfmt [flags] # runs on package in current directory\n")
log.Printf("\ncfmt [flags] [packages]\n")
log.Printf("Flags:\n")
flag.PrintDefaults()
}
func main() {
// Remove log timestamp
log.SetFlags(0)
maxCommentLength := flag.Uint("m", 80, "max comment length")
write := flag.Bool("w", false, "write changes to file")
flag.Usage = usage
flag.Parse()
if err := wrapComments(flag.Args(), *maxCommentLength, *write); err != nil {
log.Println(err)
}
}