fixed: command-line mode detection (thanks to @giordanovi)