Noninteractive-mode support

This resolves #1