-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
38 lines (33 loc) · 756 Bytes
/
Copy pathmain.go
File metadata and controls
38 lines (33 loc) · 756 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
34
35
36
37
38
//go:generate go get github.com/kballard/go-shellquote
//go:generate go build main.go expansions.go shell.go command.go strings.go
//go:generate sh -c "GOOS=windows GOARCH=amd64 go build main.go expansions.go shell.go command.go strings.go"
//go:generate mv ./main /usr/local/bin/lup
//go:generate mv ./main.exe lup.exe
package main
import (
"fmt"
"os"
)
var (
version = "v0.4.0"
shell string
input string
dryRun = false
delimiter = '@'
hider = "-:"
testrun = false
)
func main() {
shell = detectShell()
input = getStdin()
c := newCommand(os.Args[1:]...)
r := c.run()
if !testrun {
os.Exit(r)
}
}
func errOn(e error, s string, r int) {
fmt.Fprintln(os.Stderr, s)
fmt.Fprintf(os.Stderr, " - %s", e)
os.Exit(r)
}