3.3.1.1 Command Completion

This subsection discusses the command completion facility, available if mix is configured with readline support. Using this feature is recommended. If you don't have GNU readline, we suggest you to get it from the Readline Home Page prior to compiling mix.

See Command Line Editing: (readline)Command Line Editing section `Command Line Editing' in GNU Readline Library, for more information about the library.

Mixsim can fill in the rest of a word in a command for you, if there is only one possibility; it can also show you what the valid possibilities are for the next word in a command, at any time.

Press the TAB key whenever you want mixsim to fill out the rest of a word for you. If there is only one possibility, it will replace the partial word and will wait for you to finish the command. This command completion is context-dependent. For example, if you type:

 
MIX> br_TAB

this command will immediately be expanded to break, since it is the only possibility in this context:

 
MIX> break

If there is more than one possibility to complete the word you are typing, mixsim rings a bell. You can either supply more characters and try again, or just press TAB one more time, in which case mixsim will display all the possible completions for that word. For example, the address command (see section Breakpoints) can be followed by several keywords, so, if you type TAB after address, mixsim rings a bell and waits for your further actions. If you press TAB second time, you'll see:

 
MIX> ADDRESS _TAB
A bell sounds. Pess TAB again to see:
CB         DELETE     ENABLE     INFO       LIST
CLEAR      DISABLE    IGNORE     LB         PASSCOUNT
MIX> ADDRESS _

To save you typing, it is also possible to view the list of alternatives in the first place. To do so, type M-?, instead of pressing TAB twice. M-? means either to hold down a key designated as the META shift on your keyboard (if there is one) while typing ?, or to press ESC, followed by ?.

If the context requires you to type a file name, mixsim will complete file names. For example:

 
MIX> ASGN 16 ../examples/_M-?
mystery.mix    hello.mix      init.mix       p.mix
easter.mix     load.mix       tsort.mix

Similarly, if the context requires a name of an executable file, you will see the appropriate completion, made using your PATH environment variable setting:

 
MIX> ! ca_TAB TAB
cat             cal