Skip to content

Commit 07dafa4

Browse files
committed
fix CLI option '--log-file' validator: same as '-o'
1 parent 8a7ba5c commit 07dafa4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/scala/decaf/driver/OptParser.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ object OptParser extends OptionParser[Config]("decaf") {
7373
.text("also dump log to a file")
7474
.action { case (f, config) => config.copy(logFile = f) }
7575
.validate { f =>
76-
if (!f.exists) {
77-
Left("file not exist: " + f)
76+
if (f.getParentFile != null && !f.getParentFile.exists) {
77+
Left("parent directory not exist: " + f.getParentFile)
7878
} else {
7979
Right()
8080
}

0 commit comments

Comments
 (0)