Using the tellEddie tool

tellEddie is a command line tool that tightly integrates Eddie with the Terminal. One of the simplest things you can do with tellEddie is open a document from the Terminal command line:

tellEddie test.cpp

test.cpp will open as a document in Eddie.

Creating a new file/file pair

To create a new file if it doesn't exist prior to opening, use the --create or -c option:
tellEddie -c test.cpp
- If test.cpp doesn't exist, a new copy will be created.

The tellEddie -c feature also offers a convenient shortcut to create a pair of .cpp/.h (or .c, .m, etc.) files. Simply run:

tellEddie -c editorframe/EditorView.mm
If the files do not exist yet, Eddie will automatically generate editorframe/EditorView.h and editorframe/EditorView.mm, ready with matching header guards and #include statements and generate a matching svn add command for you to execute in the Worksheet to add your new files to the project. The editorframe/EditorView.mm opens and you are ready to start coding, all with a single command:
tellEddie -c editorframe/EditorView.mm
# Created new editorframe/EditorView.h editorframe/EditorView.mm -- execute the following line to add the files to subversion:
svn add editorframe/EditorView.h editorframe/EditorView.mm

Opening tabs

When opening documents you can control whether or not tabs or separate windows get created. By default the documents open based on your "Open documents as tabs" setting. To force-open a document in a tab use:

tellEddie -d editorframe/EditorView.mm
This option will force EditorView.mm to be added as a tab to the current target document.

To open a batch of documents as tabs in a new window, use:

tellEddie -t editorframe/Editor*
Any file that matches the wildcard will open as a tab in the resulting new window.

You can of course combine this option with grep or other useful commands:

grep tabs -l shell/editorextras/* | xargs tellEddie -t
This will open all the matching files as tabs in a new window.

To force opening a new window, even if you have the "Open documents as tabs" setting enabled, use:

tellEddie -x editorframe/EditorView.mm
EditorView.mm will open in a separate window.

Selecting lines in the opened document

You may also specify a line to select upon opening the file:

tellEddie test.cpp:10 test.h:20

As per the example above, this works on an arbitrary list of files.

You can also a line and a column or a line and a start column and end column:

tellEddie test.cpp:10:5
tellEddie test.h:10:5:7

Piping text via tellEddie into Eddie

Aside from opening normal documents in Eddie, tellEddie can also be used to pipe any stdout into a new Eddie window. You can for instance type this in the Terminal (or a Worksheet window):

svn diff | tellEddie
- the resulting diffs will be shown in a new Eddie window.

When piping some temporary output, you may prefer to treat the resulting document as transient and not be prompted to save when you attempt to close it. The --noSave option allows you to do just that:

cvs diff | tellEddie --noSave
- as before, the resulting diffs will be shown in a new Eddie window. When you attempt to close the window, you will not be prompted to save the document (you may still save it by using the Save menu item). This is handy when you want to display a temporary output in a window and close it when you are done without being bothered with the save dialog.

See Shell tips for more neat piping tricks.

Using tellEddie with source control tools

tellEddie can be used to open a document in a running copy of Eddie and block the command line until the window corresponding to the open document gets closed. This feature is useful with some source control systems such as CVS, Subversion, git or Perforce for writing checkin notes, etc. Usually systems like this are preconfigured with the editor of your choice (which could be Eddie in your case). During a checkin the editor gets launched from the command line you invoked the checkin command from, you type up your checkin notes and close the editor which makes the checkin proceed with checking in files. If you are already running Eddie (you may be executing the checkin commands from your Worksheet), this will not work because Eddie is already running and the launch Eddie command will return immediately without the checkin notes being typed up. To prevent this, you may use the blocking feature of tellEddie. Configure your source control environment to list:

export EDITOR='tellEddie -w'
or a corresponding command, depending on the syntax. The -w option used with tellEddie will cause the file opened as a result to block the command line that invoked it until the corresponding window is closed.

More on tellEddie

tellEddie is also used to pipe built-in commands (such as SetKey, Primitives, etc.) from a Worksheet or a shell window back into Eddie for execution. It ensures shell variables are properly expanded and evaluated making the builtin shell commands well integrated with the rest of the original bash commands and makes them behave identically.

tellEddie provides help for the built-in Eddie shell commands. Type:

tellEddie -h 
to learn more.

Configuring your environment to make tellEddie even more handy

If you are a frequent Eddie user, you will likely find yourself using tellEddie a lot. Go ahead and copy tellEddie into /usr/bin to make visible in $PATH. Also, bind tellEddie to short alias for convenience inside your ~/.bash_profile:

 alias e='tellEddie'