@@ -42,7 +42,7 @@ var tr = i18n.Tr
42
42
var portArgs arguments.Port
43
43
var describe bool
44
44
var configs []string
45
- var silent bool
45
+ var quiet bool
46
46
47
47
// NewCommand created a new `monitor` command
48
48
func NewCommand () * cobra.Command {
@@ -58,7 +58,7 @@ func NewCommand() *cobra.Command {
58
58
portArgs .AddToCommand (cmd )
59
59
cmd .Flags ().BoolVar (& describe , "describe" , false , tr ("Show all the settings of the communication port." ))
60
60
cmd .Flags ().StringSliceVarP (& configs , "config" , "c" , []string {}, tr ("Configuration of the port." ))
61
- cmd .Flags ().BoolVarP (& silent , "silent " , "s " , false , tr ("Run in silent mode, show only monitor input and output." ))
61
+ cmd .Flags ().BoolVarP (& quiet , "quiet " , "q " , false , tr ("Run in silent mode, show only monitor input and output." ))
62
62
cmd .MarkFlagRequired ("port" )
63
63
return cmd
64
64
}
@@ -67,7 +67,7 @@ func runMonitorCmd(cmd *cobra.Command, args []string) {
67
67
instance := instance .CreateAndInit ()
68
68
69
69
if ! configuration .HasConsole {
70
- silent = true
70
+ quiet = true
71
71
}
72
72
73
73
port , err := portArgs .GetPort (instance , nil )
@@ -108,7 +108,6 @@ func runMonitorCmd(cmd *cobra.Command, args []string) {
108
108
feedback .Error (err )
109
109
os .Exit (errorcodes .ErrGeneric )
110
110
}
111
- settings := resp .GetSettings ()
112
111
for _ , config := range configs {
113
112
split := strings .SplitN (config , "=" , 2 )
114
113
k := ""
@@ -119,7 +118,7 @@ func runMonitorCmd(cmd *cobra.Command, args []string) {
119
118
}
120
119
121
120
var setting * rpc.MonitorPortSettingDescriptor
122
- for _ , s := range settings {
121
+ for _ , s := range resp . GetSettings () {
123
122
if k == "" {
124
123
if contains (s .EnumValues , v ) {
125
124
setting = s
@@ -144,8 +143,9 @@ func runMonitorCmd(cmd *cobra.Command, args []string) {
144
143
SettingId : setting .SettingId ,
145
144
Value : v ,
146
145
})
147
- if ! silent {
148
- feedback .Print (fmt .Sprintf ("Set %s to %s" , setting .SettingId , v ))
146
+ if ! quiet {
147
+ feedback .Print (tr ("Monitor port settings:" ))
148
+ feedback .Print (fmt .Sprintf ("%s=%s" , setting .SettingId , v ))
149
149
}
150
150
}
151
151
}
@@ -177,7 +177,7 @@ func runMonitorCmd(cmd *cobra.Command, args []string) {
177
177
cancel ()
178
178
}()
179
179
180
- if ! silent {
180
+ if ! quiet {
181
181
feedback .Print (tr ("Connected to %s! Press CTRL-C to exit." , port .String ()))
182
182
}
183
183
0 commit comments