cmdline_tools

Tools for command line use of IDL

Overview

The cmdline_tools package is a library of routines to make using the IDL command line more convenient.

There are several routines that are convenient in normal interactive use of IDL. For example, pwd is similar to the UNIX command of the same name for printing the name of the current working directory:

IDL> pwd
/Users/mgalloy/projects/cmdline_tools

The ls command is also useful in normal interactive use for printing a listing of files:

There are also routines that handle command line issues like setting/querying preferences. The MG_SET_PATH routine sets the !path, or !dlm_path if the DLM keyword is set, using PREF_SET. MG_SET_PATH handles expanding path specifications using EXPAND_PATH and also allows particular elements of the directory specification array to be commented out using a ;.

The MG_FILE_WHICH routine is a wrapper for FILE_WHICH, but adds an ALL boolean keyword that reports all files found instead of just the first one:

Using the command line for debugging can be tedious, but the MG_BREAKPOINT routine helps by finding routines in your !path instead of having to manually specify a path to the routine:

IDL> mg_breakpoint, 'man', 487

This will find the file containing the MAN routine and set a breakpoint on line 487.

Querying the terminal for its properties and printing to the terminal is another category of routines in this library. MG_TERMLINES, MG_TERMCOLUMNS, and MG_TERMISTTY provide characteristics of the current terminal window. For example, when I use IDL from a command line terminal, the output looks like: