From 104ee66f5930f4a37ac84538c29a291bf1d08f4f Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Tue, 24 Jan 2023 20:27:22 +0800 Subject: Use cobra as command selector --- main.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 99ae88c..c967b6e 100644 --- a/main.go +++ b/main.go @@ -1,15 +1,17 @@ package main -import "os" +// import "os" + +import ( + "gxlin.org/zk/cmd" + "gxlin.org/zk/pkg" +) func main() { - DocCollection = NewDocs(".") - if DocCollection == nil { + pkg.DocCollection = pkg.NewDocs(".") + if pkg.DocCollection == nil { panic("Unable to initialize collection") } - if len(os.Args) > 3 && os.Args[1] == "mv" { - Rename(os.Args[2], os.Args[3]) - } - + cmd.Execute() } -- cgit v1.2.3