use the directory suffix if no @ is in input

 * add tests!
 * potential upstream commit