knewjade / solution-finder

Tetris: Find perfect clears, combos, T-spins
https://solution-finder.readthedocs.io
MIT License
103 stars 12 forks source link

Output CSV data to stdout #6

Closed netthier closed 2 years ago

netthier commented 2 years ago

I possibly missed this while reading the docs, but there doesn't seem to be a way to output the CSV data generated by subcommands such as path or setup to stdout instead of a file. Attempting to use -o - results in an error:

$ java -jar sfinder.jar path -t v115@BhF8CeG8BeH8CeG8JeAgWDAqedBA -p "*p4" -f csv -k solution -o -

[snip]

# Output file
Error: Failed to execute main. Output stack trace to output/error.txt
Message: Cannot invoke "java.io.File.exists()" because the return value of "java.io.File.getParentFile()" is null
java.lang.NullPointerException: Cannot invoke "java.io.File.exists()" because the return value of "java.io.File.getParentFile()" is null
        at entry.path.output.MyFile.mkdirs(MyFile.java:23)
        at entry.path.output.FumenCSVPathOutput.<init>(FumenCSVPathOutput.java:42)
        at entry.path.PathEntryPoint.createOutput(PathEntryPoint.java:329)
        at entry.path.PathEntryPoint.run(PathEntryPoint.java:204)
        at entry.EntryPointMain.main(EntryPointMain.java:92)
        at Main.main(Main.java:5)
knewjade commented 2 years ago

I supported in v1.20. Thank you for your request!