cmdLine will return file with args

This commit is contained in:
tongjingran 2021-07-19 16:31:42 +08:00
parent b8b7305fc8
commit 465d6c506f
4 changed files with 5 additions and 3 deletions

View File

@ -21,7 +21,7 @@ var listWide bool
func init() {
listCmd.Flags().StringVar(&config.GocConfig.Host, "host", "127.0.0.1:7777", "specify the host of the goc server")
listCmd.Flags().BoolVar(&listWide, "wide", false, "List all services with more information (such as pid)")
listCmd.Flags().BoolVar(&listWide, "wide", false, "list all services with more information (such as pid)")
rootCmd.AddCommand(listCmd)
}

View File

@ -82,6 +82,7 @@ func (c *client) ListAgents(wide bool) {
table.SetNoWhiteSpace(true)
table.SetReflowDuringAutoWrap(false)
table.SetHeaderAlignment(tablewriter.ALIGN_LEFT)
table.SetAutoWrapText(false)
if wide {
table.SetHeader([]string{"ID", "REMOTEIP", "HOSTNAME", "PID", "CMD"})
table.SetColumnAlignment([]int{tablewriter.ALIGN_LEFT, tablewriter.ALIGN_LEFT, tablewriter.ALIGN_LEFT, tablewriter.ALIGN_LEFT, tablewriter.ALIGN_LEFT, tablewriter.ALIGN_LEFT})

View File

@ -204,7 +204,7 @@ func getRegisterInfo() (*processInfo, error) {
pid := os.Getpid()
cmdline := os.Args[0]
cmdline := strings.Join(os.Args, " ")
return &processInfo{
hostname: hostname,

View File

@ -6,6 +6,7 @@ import (
"os"
"log"
"strconv"
"strings"
"net/url"
"{{.GlobalCoverVarImportPath}}/websocket"
@ -115,7 +116,7 @@ func getRegisterInfo() (*processInfo, error) {
pid := os.Getpid()
cmdline := os.Args[0]
cmdline := strings.Join(os.Args, " ")
return &processInfo{
hostname: hostname,