-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
33 lines (25 loc) · 515 Bytes
/
Copy pathmain.go
File metadata and controls
33 lines (25 loc) · 515 Bytes
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
package main
import (
"fmt"
"io"
"os"
"github.com/mickamy/adms/internal/cli"
"github.com/mickamy/adms/internal/exit"
)
var version = "dev"
func main() {
os.Exit(run(os.Args[1:], os.Stdout, os.Stderr))
}
func run(args []string, stdout, stderr io.Writer) int {
if len(args) > 0 {
switch args[0] {
case "--version", "-v":
fmt.Fprintf(stdout, "adms %s\n", version)
return exit.OK
case "--help", "-h":
cli.PrintUsage(stdout)
return exit.OK
}
}
return cli.Run(args, stdout, stderr)
}