cmdLine will return file with args
This commit is contained in:
parent
b8b7305fc8
commit
465d6c506f
@ -21,7 +21,7 @@ var listWide bool
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
listCmd.Flags().StringVar(&config.GocConfig.Host, "host", "127.0.0.1:7777", "specify the host of the goc server")
|
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)
|
rootCmd.AddCommand(listCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,6 +82,7 @@ func (c *client) ListAgents(wide bool) {
|
|||||||
table.SetNoWhiteSpace(true)
|
table.SetNoWhiteSpace(true)
|
||||||
table.SetReflowDuringAutoWrap(false)
|
table.SetReflowDuringAutoWrap(false)
|
||||||
table.SetHeaderAlignment(tablewriter.ALIGN_LEFT)
|
table.SetHeaderAlignment(tablewriter.ALIGN_LEFT)
|
||||||
|
table.SetAutoWrapText(false)
|
||||||
if wide {
|
if wide {
|
||||||
table.SetHeader([]string{"ID", "REMOTEIP", "HOSTNAME", "PID", "CMD"})
|
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})
|
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()
|
pid := os.Getpid()
|
||||||
|
|
||||||
cmdline := os.Args[0]
|
cmdline := strings.Join(os.Args, " ")
|
||||||
|
|
||||||
return &processInfo{
|
return &processInfo{
|
||||||
hostname: hostname,
|
hostname: hostname,
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"log"
|
"log"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"{{.GlobalCoverVarImportPath}}/websocket"
|
"{{.GlobalCoverVarImportPath}}/websocket"
|
||||||
@ -115,7 +116,7 @@ func getRegisterInfo() (*processInfo, error) {
|
|||||||
|
|
||||||
pid := os.Getpid()
|
pid := os.Getpid()
|
||||||
|
|
||||||
cmdline := os.Args[0]
|
cmdline := strings.Join(os.Args, " ")
|
||||||
|
|
||||||
return &processInfo{
|
return &processInfo{
|
||||||
hostname: hostname,
|
hostname: hostname,
|
||||||
|
Loading…
Reference in New Issue
Block a user