Add shorthand versions of -echo and -verbose to `include`. (#236)

* Add shorthand versions of -echo and -verbose to `include`.

This improves compatibility with other SDC based tools.

* Add documentation changes for `include -e -v`, and use ||.
This commit is contained in:
Logikable 2025-04-17 16:50:16 -07:00 committed by GitHub
parent 16b6bbb21c
commit 98c04dbb71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

Binary file not shown.

Binary file not shown.

View File

@ -366,16 +366,16 @@ proc check_percent { cmd_arg arg } {
set ::sta_continue_on_error 0
define_cmd_args "include" \
{[-echo] filename [> filename] [>> filename]}
{[-e|-echo] [-v|-verbose] filename [> filename] [>> filename]}
# Tcl "source" command analog to support -echo and -verbose return values.
proc_redirect include {
parse_key_args "include" args keys {-encoding} flags {-echo -verbose}
parse_key_args "include" args keys {-encoding} flags {-e -echo -v -verbose}
if { [llength $args] != 1 } {
cmd_usage_error "include"
}
set echo [info exists flags(-echo)]
set verbose [info exists flags(-verbose)]
set echo [expr [info exists flags(-echo)] || [info exists flags(-e)]]
set verbose [expr [info exists flags(-verbose)] || [info exists flags(-v)]]
set filename [file nativename [lindex $args 0]]
include_file $filename $echo $verbose
}