telnet/auto-complete: hide deprecated and internal commands

For both:
- TCL proc that redirect deprecated commands to the new commands,
- TCL proc used internally and not supposed to be exposed to user,
add their name to the list of commands that should be hide by the
telnet auto-complete.

Change-Id: I05237c6a79334b7d2b151dfb129fb57b2f40bba6
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6195
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
This commit is contained in:
Antonio Borneo 2021-04-26 14:44:48 +02:00
parent 5ba8e365d9
commit 223b79ebe2
4 changed files with 22 additions and 0 deletions

View File

@ -6,6 +6,7 @@
# optional args: verify, reset, exit and address
#
lappend _telnet_autocomplete_skip program_error
proc program_error {description exit} {
if {$exit == 1} {
echo $description

View File

@ -119,6 +119,7 @@ proc jtag_ntrst_assert_width args {
#
# FIXME phase these aids out after some releases
#
lappend _telnet_autocomplete_skip jtag_reset
proc jtag_reset args {
echo "DEPRECATED! use 'adapter \[de\]assert' not 'jtag_reset'"
switch $args {
@ -135,51 +136,61 @@ proc jtag_reset args {
}
}
lappend _telnet_autocomplete_skip adapter_khz
proc adapter_khz args {
echo "DEPRECATED! use 'adapter speed' not 'adapter_khz'"
eval adapter speed $args
}
lappend _telnet_autocomplete_skip adapter_name
proc adapter_name args {
echo "DEPRECATED! use 'adapter name' not 'adapter_name'"
eval adapter name $args
}
lappend _telnet_autocomplete_skip adapter_nsrst_delay
proc adapter_nsrst_delay args {
echo "DEPRECATED! use 'adapter srst delay' not 'adapter_nsrst_delay'"
eval adapter srst delay $args
}
lappend _telnet_autocomplete_skip adapter_nsrst_assert_width
proc adapter_nsrst_assert_width args {
echo "DEPRECATED! use 'adapter srst pulse_width' not 'adapter_nsrst_assert_width'"
eval adapter srst pulse_width $args
}
lappend _telnet_autocomplete_skip interface
proc interface args {
echo "DEPRECATED! use 'adapter driver' not 'interface'"
eval adapter driver $args
}
lappend _telnet_autocomplete_skip interface_transports
proc interface_transports args {
echo "DEPRECATED! use 'adapter transports' not 'interface_transports'"
eval adapter transports $args
}
lappend _telnet_autocomplete_skip interface_list
proc interface_list args {
echo "DEPRECATED! use 'adapter list' not 'interface_list'"
eval adapter list $args
}
lappend _telnet_autocomplete_skip ftdi_location
proc ftdi_location args {
echo "DEPRECATED! use 'adapter usb location' not 'ftdi_location'"
eval adapter usb location $args
}
lappend _telnet_autocomplete_skip xds110_serial
proc xds110_serial args {
echo "DEPRECATED! use 'xds110 serial' not 'xds110_serial'"
eval xds110 serial $args
}
lappend _telnet_autocomplete_skip xds110_supply_voltage
proc xds110_supply_voltage args {
echo "DEPRECATED! use 'xds110 supply' not 'xds110_supply_voltage'"
eval xds110 supply $args
@ -189,6 +200,7 @@ proc hla {cmd args} {
tailcall "hla $cmd" {*}$args
}
lappend _telnet_autocomplete_skip "hla newtap"
proc "hla newtap" {args} {
echo "DEPRECATED! use 'swj_newdap' not 'hla newtap'"
eval swj_newdap $args

View File

@ -9,6 +9,9 @@ proc ocd_gdb_restart {target_id} {
reset halt
}
lappend _telnet_autocomplete_skip prevent_cps
lappend _telnet_autocomplete_skip POST
lappend _telnet_autocomplete_skip Host:
proc prevent_cps {} {
echo "Possible SECURITY ATTACK detected."
echo "It looks like somebody is sending POST or Host: commands to OpenOCD."

View File

@ -208,31 +208,37 @@ proc init_board {} {
}
# smp_on/smp_off were already DEPRECATED in v0.11.0 through http://openocd.zylin.com/4615
lappend _telnet_autocomplete_skip "aarch64 smp_on"
proc "aarch64 smp_on" {args} {
echo "DEPRECATED! use 'aarch64 smp on' not 'aarch64 smp_on'"
eval aarch64 smp on $args
}
lappend _telnet_autocomplete_skip "aarch64 smp_off"
proc "aarch64 smp_off" {args} {
echo "DEPRECATED! use 'aarch64 smp off' not 'aarch64 smp_off'"
eval aarch64 smp off $args
}
lappend _telnet_autocomplete_skip "cortex_a smp_on"
proc "cortex_a smp_on" {args} {
echo "DEPRECATED! use 'cortex_a smp on' not 'cortex_a smp_on'"
eval cortex_a smp on $args
}
lappend _telnet_autocomplete_skip "cortex_a smp_off"
proc "cortex_a smp_off" {args} {
echo "DEPRECATED! use 'cortex_a smp off' not 'cortex_a smp_off'"
eval cortex_a smp off $args
}
lappend _telnet_autocomplete_skip "mips_m4k smp_on"
proc "mips_m4k smp_on" {args} {
echo "DEPRECATED! use 'mips_m4k smp on' not 'mips_m4k smp_on'"
eval mips_m4k smp on $args
}
lappend _telnet_autocomplete_skip "mips_m4k smp_off"
proc "mips_m4k smp_off" {args} {
echo "DEPRECATED! use 'mips_m4k smp off' not 'mips_m4k smp_off'"
eval mips_m4k smp off $args