diff --git a/gen-rc-go.py b/gen-rc-go.py index bca245b62..87e8cd28b 100755 --- a/gen-rc-go.py +++ b/gen-rc-go.py @@ -34,6 +34,7 @@ class Option: self.short, self.long = short, long self.usage = serialize_as_go_string(x['help'].strip()) self.type = x['type'] + self.dest = x['dest'] def to_flag_definition(self, base: str = 'ans.Flags()') -> str: if self.type == 'bool-set': @@ -53,12 +54,16 @@ def build_go_code(name: str, cmd: RemoteCommand, seq: OptionSpecSeq, template: s continue o = Option(x) a(o.to_flag_definition()) + if o.dest == 'no_response': + continue ans = replace( template, CMD_NAME=name, __FILE__=__file__, CLI_NAME=name.replace('_', '-'), SHORT_DESC=serialize_as_go_string(cmd.short_desc), LONG_DESC=serialize_as_go_string(cmd.desc.strip()), - NO_RESPONSE_BASE=NO_RESPONSE_BASE, ADD_FLAGS_CODE='\n'.join(af)) + NO_RESPONSE_BASE=NO_RESPONSE_BASE, ADD_FLAGS_CODE='\n'.join(af), + WAIT_TIMEOUT=str(cmd.response_timeout), + ) return ans diff --git a/tools/cmd/at/main.go b/tools/cmd/at/main.go index 65e5d2f65..eb2811ef3 100644 --- a/tools/cmd/at/main.go +++ b/tools/cmd/at/main.go @@ -90,7 +90,7 @@ func create_serializer(password string, encoded_pubkey string) (ans serializer_f return simple_serializer, nil } -func send_rc_command(rc *utils.RemoteControlCmd) (err error) { +func send_rc_command(rc *utils.RemoteControlCmd, timeout float64) (err error) { serializer, err = create_serializer(global_options.password, "") if err != nil { return diff --git a/tools/cmd/at/template.go b/tools/cmd/at/template.go index 40492bc20..34f2917d0 100644 --- a/tools/cmd/at/template.go +++ b/tools/cmd/at/template.go @@ -21,7 +21,7 @@ func run_CMD_NAME(cmd *cobra.Command, args []string) (err error) { if err == nil { rc.NoResponse = nrv } - err = send_rc_command(&rc) + err = send_rc_command(&rc, WAIT_TIMEOUT) return }