2021-04-20 21:31:37 +00:00
|
|
|
package entrypoint
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
crypticnet "cryptic-net"
|
|
|
|
)
|
|
|
|
|
|
|
|
// The purpose of this binary is to act as the entrypoint of the cryptic-net
|
|
|
|
// process. It processes the command-line arguments which are passed in, and
|
|
|
|
// then passes execution along to an appropriate binary housed in AppDir/bin
|
|
|
|
// (usually a bash script, which is more versatile than a go program).
|
|
|
|
|
|
|
|
func Main() {
|
|
|
|
|
|
|
|
env, err := crypticnet.NewEnv(true)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
panic(fmt.Sprintf("loading environment: %v", err))
|
|
|
|
}
|
|
|
|
|
|
|
|
err = subCmdCtx{
|
|
|
|
args: os.Args[1:],
|
|
|
|
env: env,
|
|
|
|
}.doSubCmd(
|
2022-10-16 15:18:50 +00:00
|
|
|
subCmdAdmin,
|
2021-04-20 21:31:37 +00:00
|
|
|
subCmdDaemon,
|
|
|
|
subCmdGarage,
|
2022-10-16 15:18:50 +00:00
|
|
|
subCmdHosts,
|
2021-04-20 21:31:37 +00:00
|
|
|
subCmdVersion,
|
|
|
|
)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|