cmdLine will return file with args
This commit is contained in:
parent
b8b7305fc8
commit
465d6c506f
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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})
|
||||
|
@ -204,7 +204,7 @@ func getRegisterInfo() (*processInfo, error) {
|
||||
|
||||
pid := os.Getpid()
|
||||
|
||||
cmdline := os.Args[0]
|
||||
cmdline := strings.Join(os.Args, " ")
|
||||
|
||||
return &processInfo{
|
||||
hostname: hostname,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user