リビジョン | 7d02a688a6b22b3d796986fcdbdbe5d70db6034c (tree) |
---|---|
日時 | 2014-12-01 21:46:39 |
作者 | argius <argius.net@gmai...> |
コミッター | argius |
indicate the absolute path when using -f option with a invalid path
@@ -3,9 +3,7 @@ package net.argius.stew; | ||
3 | 3 | import java.io.*; |
4 | 4 | import java.sql.*; |
5 | 5 | import java.util.*; |
6 | - | |
7 | 6 | import javax.script.*; |
8 | - | |
9 | 7 | import net.argius.stew.io.*; |
10 | 8 | import net.argius.stew.ui.*; |
11 | 9 |
@@ -109,7 +107,7 @@ final class CommandProcessor { | ||
109 | 107 | outputMessage("i.exit"); |
110 | 108 | return false; |
111 | 109 | } |
112 | - // connect | |
110 | + // connect | |
113 | 111 | if (commandName.equalsIgnoreCase("connect") || commandName.equalsIgnoreCase("-c")) { |
114 | 112 | connect(p); |
115 | 113 | return true; |
@@ -117,7 +115,12 @@ final class CommandProcessor { | ||
117 | 115 | // from file |
118 | 116 | if (commandName.equals("-f")) { |
119 | 117 | final File file = Path.resolve(env.getCurrentDirectory(), p.at(1)); |
118 | + final String abspath = file.getAbsolutePath(); | |
119 | + if (log.isDebugEnabled()) { | |
120 | + log.debug("absolute path = [%s]", abspath); | |
121 | + } | |
120 | 122 | if (!file.isFile()) { |
123 | + outputMessage("e.file-not-exists", abspath); | |
121 | 124 | throw new UsageException(res.get("usage.-f")); |
122 | 125 | } |
123 | 126 | log.debug("-f %s", file.getAbsolutePath()); |