Command and help enhancement, esp. ALIAS, FUNCTION and SET

#1
There are two minor issues of using the ALIAS command to list aliases. There
exist additional minor enhancement possibilities.

1/ The asterisk * character can have two, conflicting interpretations:

1.1/ * is the character in the alias name showing the shortest form of the
alias
1.2/ * is the wildcard requesting display of many aliases

The usual (but documented in neither of the help topics "wildcards.htm" and
"alias.htm") wildcard interpretation rule applies, i.e., if there is an
exact match, only that is reported, and wildcard matches, if any, are not
reported. For example, I have the following aliases:

desc*riptions=call %bat\descript.btm DESC %&
desca=call %bat\descript.btm ALL %&
descas=call %bat\descript.btm ALLS %&
descs=call %bat\descript.btm DESCS %&

Attempting to list all the above aliases using the command "ALIAS DESC*"
reports:

call %bat\descript.btm DESC %&

There is an undocumented solution: the use of ?* instead of * in the ALIAS
command, e.g. "ALIAS DESC?*", which provides the report of all matching
commands (as shown above). I suggest documenting this solution in help
topics "wildcards.htm" and "alias.htm" (in all still supported versions).

2/ There are two reporting formats:
2.1/ the long form, showing all matching alias names (including embedded
abbreviation mark asterisks) and their respective definitions (for example,
my first report above), and
2.2/ short form, showing only the alias definition of the single "perfect"
match

My quibble is with 2.2, the short form report, when the queried alias name
includes an asterisk - the actually defined form of the alias name is not
included in the report.

I suggest addition of a new option, e.g. /F(ull), which would always report
in long form, even if there is only a single match. This would provide
backward compatibility while providing a uniform output format for all
cases.

3/ In all three commands, ALIAS, FUNCTION and SET, which can either define
or report pairs of names and corresponding values, there is often the desire
to have a single report of multiple names, esp. during batch program
development. I recommend a new option, e.g. /Q(uery) - an option letter not
used by any of these commands - that would specify that the command tail is
a list of names to be reported on. For example:
alias /q pre_input pre_exec post_exec unknown_cmd
--
Steve
 
#2
Steve Fábián wrote:

> There is an undocumented solution: the use of ?* instead of * in the ALIAS
> command, e.g. "ALIAS DESC?*", which provides the report of all matching
> commands (as shown above).
>
For whatever it's worth, I discovered long ago (by accident) that using
two asterisks, e.g., DESC**, accomplishes the same thing.
 
#3
WavSlave wrote:
| Steve Fábián wrote:
|| There is an undocumented solution: the use of ?* instead of * in
|| the ALIAS command, e.g. "ALIAS DESC?*", which provides the report
|| of all matching commands (as shown above).

| For whatever it's worth, I discovered long ago (by accident) that using
| two asterisks, e.g., DESC**, accomplishes the same thing.

Thanks, that's always easier to type...
--
Steve