aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/sharefs/main.go
blob: 60924e06801e509a6bf98d18c1a7e39861c4946d (plain)
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
package main

import (
	"log"
	"os"
	"path"
	"runtime"
)

// executableName is the [path.Base] name of the executable that started the current process.
var executableName = func() string {
	if len(os.Args) > 0 {
		return path.Base(os.Args[0])
	} else if name, err := os.Executable(); err != nil {
		return "sharefs"
	} else {
		return path.Base(name)
	}
}()

func main() {
	runtime.LockOSThread()
	log.SetFlags(0)
	log.SetPrefix(executableName + ": ")

	os.Exit(_main(len(os.Args), copyStrings(os.Args...)))
}