Example swift command line app that shows how to link libedit for better line editing and command history.
The built-in Xcode console is broken and won't work with this. Follow the instructions in this SO post to update your scheme to launch under a real terminal to test.
http://stackoverflow.com/questions/7780301/how-to-run-command-line-application-from-the-terminal