nickdiego / compiledb

Tool for generating Clang's JSON Compilation Database files for make-based build systems.
GNU General Public License v3.0
1.38k stars 123 forks source link

Fix output option for stdout (fixes #62) #63

Closed rzuckerm closed 5 years ago

rzuckerm commented 5 years ago
agnjunio commented 5 years ago

I think this feature could be more effective with a silent mode default for stdout outputs, but this works fine.

nickdiego commented 5 years ago

I think we can improve this. Could you try to revert to use Click.File arguments for output, but opening it for reading+writing (trivial example here), this way we could use direct comparison against sys.stdout to avoid trying to load compdb from stdout, what IMHO would be way more elegant and readable.

rzuckerm commented 5 years ago

@nickdiego My first approach was to try click.File('rw'), but that didn't work if the file didn't exist. Can this PR be merged? Thanks!

nickdiego commented 5 years ago

Thanks for contributing @rzuckerm and sorry for the delay.