hasktags icon indicating copy to clipboard operation
hasktags copied to clipboard

The `--tags-absolute` option is incompatible with reading files from `stdin`.

Open ntc2 opened this issue 8 years ago • 1 comments

Doing

hasktags --tags-absolute STDIN

results in the error

hasktags: STDIN: canonicalizePath: does not exist (No such file or directory)

because canonicalizePath is applied to all files at https://github.com/MarcWeber/hasktags/blob/7a492fcabcc1ed839be442f43350dcd967f6169e/src/Main.hs#L77.

It think the correct behavior is to first convert STDIN into a list of files read from stdin and then call canonicalizePath. If you agree with this solution and don't want to implement it yourself, I would be happy to submit a pull request.

ntc2 avatar Mar 03 '16 03:03 ntc2

Work around on systems with readlink -f (Linux has it but Mac does not, I think):

<generate files> | xargs -n1 readlink -f | hasktags STDIN

ntc2 avatar Mar 03 '16 03:03 ntc2