The pragmas Metashell provides

Metashell provides a number of pragmas controlling the shell. Note that these pragmas are available only from the shell's command prompt. If you put them in a header file and include that header, these pragmas will be ignored. The pragmas accepted by Metashell begin with #pragma metashell. Since this is a long prefix to type, Metashell accepts shorter versions as well. Here is the complete list of accepted forms. All of them are equivalent:

  • #pragma metashell
  • #pragma msh
  • #metashell
  • #msh

Metashell supports the following pragmas:

  • #msh config
    Lists all available configs.

  • #msh config load <name>
    Loads the config in the shell (keeping the environment).

  • #msh config show <name>
    Shows the details of a config.

  • #msh echo <text>
    Display a comment containing .

  • #msh environment
    Displays the entire content of the environment.

  • #msh environment add <code>
    Appends code to the environment. Use this if Metashell thinks about the code that it is an evaluation.

  • #msh environment pop
    Pops the last environment from the environment stack.

  • #msh environment push
    Pushes the current environment to the environment stack.

  • #msh environment reload
    Re-reads the included header files from disc.

  • #msh environment reset
    Resets the environment to its initial state. It does not change the environment stack.

  • #msh environment save <path>
    Saves the environment into a file. This is disabled by default. It can be enabled using the --enable_saving command line argument.

  • #msh environment stack
    Displays the size of the environment stack.

  • #msh evaluate <code>
    Evaluates code as a metaprogram. Use this if Metashell thinks about the code that it is an addition to the environment.

  • #msh help [<command>]
    Displays a help message.

  • #msh included headers [<expression>]
    Displays the list of header files (recursively) included into the environment. When is provided, it displays the headers added to the envrionment by . Headers that are included multiple times are listed only once. Headers that are not included because of being in a conditional (#if ... #endif) part that is skipped are not listed.

  • #msh ls {<include file>|"include file"}
    Lists the available header files in the directories specified by the arguments.

  • #msh macro names
    Displays the names of the defined macros

  • #msh macros
    Displays the macro definitions

  • #msh mdb [-full|-profile] [-nocache] [<type>|-]
    Starts the metadebugger. For more information see evaluate in the metadebugger command reference.

  • #msh metaprogram evaluation [on|1|off|0]
    Turns evaluation of metaprograms on or off. When no arguments are used, it displays if evaluation of metaprograms is turned on.

  • #msh metaprogram mode
    Set Metashell to metaprogram mode

  • #msh pdb [-profile] [-nocache] [<expression>|-]
    Starts the preprocessor debugger. For more information see evaluate in the preprocessor debugger command reference.

  • #msh pp <exp>
    Displays the preprocessed expression.

  • #msh precompiled_headers [on|1|off|0]
    Turns precompiled header usage on or off. When no arguments are used, it displays if precompiled header usage is turned on.

  • #msh preprocessed echo [on|1|off|0]
    Turns display preprocessed commands on or off. When no arguments are used, it displays if display preprocessed commands is turned on.

  • #msh preprocessor mode
    Set Metashell to preprocessor mode

  • #msh quit
    Terminates the shell.

  • #msh quoteincludes
    Displays the directories checked for #include "..."

  • #msh show cpp_errors [on|1|off|0]
    Turns display C++ errors on or off. When no arguments are used, it displays if display C++ errors is turned on.

  • #msh sysincludes
    Displays the directories checked for #include <...>

  • #msh verbose [on|1|off|0]
    Turns verbose mode on or off. When no arguments are used, it displays if verbose mode is turned on.

  • #msh which [-all] <include file>|"include file"
    Searches the given include file on the include path. When -all is provided, it displays all headers found, not just the first one.