OpenTTD Source 20260218-master-g2123fca5ea
IConsoleAlias Struct Reference

–Aliases– Aliases are like shortcuts for complex functions, variable assignments, etc. More...

#include <console_internal.h>

Public Member Functions

 IConsoleAlias (const std::string &name, std::string_view cmdline)

Data Fields

std::string name
 name of the alias
std::string cmdline
 command(s) that is/are being aliased

Detailed Description

–Aliases– Aliases are like shortcuts for complex functions, variable assignments, etc.

You can use a simple alias to rename a longer command (eg 'set' for 'setting' for example), or concatenate more commands into one (eg. 'ng' for 'load A; unpause; debug_level 5'). Aliases can parse the arguments given to them in the command line.

  • "%A - %Z" substitute arguments 1 t/m 26
  • "%+" lists all parameters keeping them separated
  • "%!" also lists all parameters but presenting them to the aliased command as one argument
  • ";" allows for combining commands (see example 'ng')

Definition at line 66 of file console_internal.h.

Constructor & Destructor Documentation

◆ IConsoleAlias()

IConsoleAlias::IConsoleAlias ( const std::string & name,
std::string_view cmdline )
inline

Definition at line 67 of file console_internal.h.

Field Documentation

◆ cmdline

std::string IConsoleAlias::cmdline

command(s) that is/are being aliased

Definition at line 70 of file console_internal.h.

Referenced by ConAlias(), ConHelp(), ConListAliases(), and IConsoleAliasExec().

◆ name

std::string IConsoleAlias::name

name of the alias

Definition at line 69 of file console_internal.h.

Referenced by ConListAliases(), and IConsoleAliasExec().


The documentation for this struct was generated from the following file: