mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-03-11 09:13:52 +00:00
Improve cmd
This commit is contained in:
parent
ecaddd897e
commit
e05ee55545
4 changed files with 11 additions and 1 deletions
cmd/sing-box
|
@ -16,6 +16,7 @@ var commandCheck = &cobra.Command{
|
||||||
Use: "check",
|
Use: "check",
|
||||||
Short: "Check configuration",
|
Short: "Check configuration",
|
||||||
Run: checkConfiguration,
|
Run: checkConfiguration,
|
||||||
|
Args: cobra.NoArgs,
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkConfiguration(cmd *cobra.Command, args []string) {
|
func checkConfiguration(cmd *cobra.Command, args []string) {
|
||||||
|
|
|
@ -18,6 +18,7 @@ var commandFormat = &cobra.Command{
|
||||||
Use: "format",
|
Use: "format",
|
||||||
Short: "Format configuration",
|
Short: "Format configuration",
|
||||||
Run: formatConfiguration,
|
Run: formatConfiguration,
|
||||||
|
Args: cobra.NoArgs,
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
@ -14,6 +14,7 @@ var commandVersion = &cobra.Command{
|
||||||
Use: "version",
|
Use: "version",
|
||||||
Short: "Print current version of sing-box",
|
Short: "Print current version of sing-box",
|
||||||
Run: printVersion,
|
Run: printVersion,
|
||||||
|
Args: cobra.NoArgs,
|
||||||
}
|
}
|
||||||
|
|
||||||
func printVersion(cmd *cobra.Command, args []string) {
|
func printVersion(cmd *cobra.Command, args []string) {
|
||||||
|
|
|
@ -5,8 +5,15 @@ package main
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
_ "net/http/pprof"
|
_ "net/http/pprof"
|
||||||
|
|
||||||
|
"github.com/sagernet/sing-box/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
go http.ListenAndServe("0.0.0.0:8964", nil)
|
go func() {
|
||||||
|
err := http.ListenAndServe("0.0.0.0:8964", nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Debug(err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue