This commit is contained in:
13
cmd/cli/main.go
Normal file
13
cmd/cli/main.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
)
|
||||
|
||||
func Main() {
|
||||
fs := flag.NewFlagSet(os.Args[0], flag.ContinueOnError)
|
||||
if err := fs.Parse(os.Args[1:]); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"os"
|
||||
|
||||
"gogs.inhome.blapointe.com/ana-ledger/cmd/cli"
|
||||
"gogs.inhome.blapointe.com/ana-ledger/cmd/http"
|
||||
)
|
||||
|
||||
@@ -11,5 +12,8 @@ func main() {
|
||||
case "http":
|
||||
os.Args = append([]string{os.Args[0]}, os.Args[2:]...)
|
||||
http.Main()
|
||||
case "cli":
|
||||
os.Args = append([]string{os.Args[0]}, os.Args[2:]...)
|
||||
cli.Main()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user