added a -c for commands instead of checking to see if stdin exists. (apparently a hard thing to do)