Optionally use readline wrapper for agavi script, closes #1180