Improved command file detection

Signed-off-by: Arthur R. Wuterich <arthurwut@gmail.com>