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

May 20, 2008
3,515
4
Elkridge, MD, USA
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
 
May 29, 2008
47
0
Orion Arm, MWG
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.
 
May 20, 2008
3,515
4
Elkridge, MD, USA
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
 
Similar threads
Thread starter Title Forum Replies Date
Alpengreis Declined Any chance for quick help with all command-options? Suggestions 3
Joe Caverly Done Specify which LIBRARY to run command from Suggestions 2
vefatica File name completion at the beginning of the command line Suggestions 6
L Done Suggestion for TCC 'ver' command Suggestions 8
JohnQSmith Done Modified last command prompt duration Suggestions 5
C Feature Request: Gain some elements of the XXCOPY feature set in COPY or a new "Mass-Copy" command Suggestions 0
D Done SHORTCUT command should accept unexpanded environment variables. Suggestions 0
mfarah Unix-like clear screen keystroke command. Suggestions 0
C Powershell ISE tabbed within Take Command Suggestions 0
D Command Input Feature Request Suggestions 0
R Done Putting command output into an array Suggestions 2
R Done Execute command while at a breakpoint Suggestions 4
R Done Allow single stepping within a command group Suggestions 5
R Declined wish-list: add a command to copy a file to clipboard. Suggestions 17
A Declined Navigation in Take Command Suggestions 4
x13 SORTARRAY command Suggestions 1
R ffind /= and command line Suggestions 0
A Declined Enhance OPTION command functionality Suggestions 2
R Done Command History Window: select more than one line. Suggestions 0
R Declined History: show in which directory a command has been typed. Suggestions 6
N Declined GUI for select command Suggestions 0
Charles Dye Done TCEDIT: Command-line option to print files Suggestions 2
Charles Dye Declined Windows functions and command: Add syntax to specify HWND directly Suggestions 0
vefatica Declined @@key alias at beginning of partial command line Suggestions 10
R Save and load a command dialog set and name it Suggestions 3
Alpengreis Done Add "Slow copy" (/WAIT) parameter to SYNC command Suggestions 1
L Completing the UnQLite command's option set Suggestions 0
joltcoder Done Support an "up" command to go to parent directory and "up3" to go up 3 directories, etc. Suggestions 4
M Declined Command line support for Virustotal Suggestions 0
A Declined Take Command/Debugger as a Visual Studio 2017 add-in/extension Suggestions 4
Joe Caverly Done UnLIBRARY command Suggestions 9
jaejunks Done Option for case-sensitive string comparison in IF command (for CMD compatibility) Suggestions 1
rps Done Log entry command Suggestions 3
rps Done Command and directory history pop-up additions Suggestions 2
rps Command History window options Suggestions 0
rps Declined Command output spacing options Suggestions 0
rps Done Command History edit additions Suggestions 0
J Done Set font in Take Command tabs in a .btm Suggestions 1
rconn Add a parameter to dir command to handle zip files as folders Suggestions 1
rconn Command Line constructor custom DIALOGs for batch files Suggestions 0
rconn A Command-line comparison Suggestions 0
rconn Done database access from command line Suggestions 0
W Done Add colorize to tree command? Suggestions 0
S Done Eject removable USB drives command Suggestions 2
ehab aboudaya Done Shortcut Key to switch between current active tab & command input Suggestions 0
M Done Start command issue... Suggestions 6
mfarah Done Proposal: new PROMPT $i special command. Suggestions 2
S Done Enhanced TYPE command Suggestions 9
C Done DIFF command Suggestions 0
S Declined New command or new ACTIVATE option request Suggestions 5

Similar threads