feat: support export config outline and config marshal (#27)

This commit is contained in:
mzz
2023-02-25 22:53:18 +08:00
committed by GitHub
parent 90dac980b9
commit 5cf6dca509
21 changed files with 689 additions and 153 deletions

31
cmd/export.go Normal file
View File

@ -0,0 +1,31 @@
/*
* SPDX-License-Identifier: AGPL-3.0-only
* Copyright (c) 2022-2023, v2rayA Organization <team@v2raya.org>
*/
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"github.com/v2rayA/dae/config"
)
var (
exportCmd = &cobra.Command{
Use: "export",
Run: func(cmd *cobra.Command, args []string) {
_ = cmd.Help()
},
}
exportOutlineCmd = &cobra.Command{
Use: "outline",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println(config.ExportOutlineJson(Version))
},
}
)
func init() {
exportCmd.AddCommand(exportOutlineCmd)
}