Skip to main content

TCC Tab Completion

Take Command and TCC introduced new tab completion syntax in version 22. Many of the internal TCC commands now have a default tab completion that automatically returns the appropriate arguments for the command name, preceding options, and position on the command line.

In additional to filenames and directories, version 22 supports three new return types:

  • aliases
  • variables
  • user-defined functions

And a new position argument:

  • [n] Only match the following extensions if the argument number is equal to n
  • [*n] Only match the following extensions if the argument number is less than or equal to n
  • [n*] Only match the following extensions if the argument number is greater than or equal to n
  • [/x] Only match the specified switch. A matching switch argument will not increase the argument value.

For example, the default completion format for ESET is:

[/a] aliases [/f] functions [1*] variables

If you do tab completion following an ESET /aTCC will return only matching aliases. A /f will return matching user-defined functions. Otherwise, TCC will return matching environment variables.

And the default completion format for ZIP is:

[1] dirs zip [2*] *

TCC will only return directories and *.zip files for the first argument, and any matching filename for the second and subsequent arguments.

You can override the default completion syntax for internal commands, or create a new syntax for external commands with the FileCompletion .INI directive or environment variable.

See What’s New in Version 22 for details on tab completion format for specific TCC internal commands.

If your completion requirements are more complex, you can create scripts using the TABCOMPLETE command in TCC.