feat: basic structure

This commit is contained in:
Noah Hsu
2022-06-06 21:48:53 +08:00
parent b76060570e
commit fced60c2b5
21 changed files with 520 additions and 4 deletions

View File

@ -1,7 +1,32 @@
package main
import "fmt"
import (
"flag"
"fmt"
"github.com/alist-org/alist/v3/bootstrap"
"github.com/alist-org/alist/v3/cmd/args"
"github.com/alist-org/alist/v3/conf"
"os"
)
func main() {
fmt.Println("Hello, world.")
func init() {
flag.StringVar(&args.Config, "conf", "data/config.json", "config file")
flag.BoolVar(&args.Debug, "debug", false, "start with debug mode")
flag.BoolVar(&args.Version, "version", false, "print version info")
flag.BoolVar(&args.Password, "password", false, "print current password")
flag.BoolVar(&args.NoPrefix, "no-prefix", false, "disable env prefix")
flag.Parse()
}
func Init() {
if args.Version {
fmt.Printf("Built At: %s\nGo Version: %s\nAuthor: %s\nCommit ID: %s\nVersion: %s\nWebVersion: %s\n",
conf.BuiltAt, conf.GoVersion, conf.GitAuthor, conf.GitCommit, conf.Version, conf.WebVersion)
os.Exit(0)
}
bootstrap.InitConfig()
bootstrap.Log()
}
func main() {
Init()
}