diff options
| author | 2015-10-04 03:42:54 +0200 | |
|---|---|---|
| committer | 2015-10-04 03:42:54 +0200 | |
| commit | 5433ecb1acedf35b266b3808010d76beecd7f869 (patch) | |
| tree | 5e79e3556d1115de3c14cd577a96719250ed9002 /src | |
| parent | When saving a theme a screenshot is now always required (diff) | |
| download | KVIrc-5433ecb1acedf35b266b3808010d76beecd7f869.tar.gz KVIrc-5433ecb1acedf35b266b3808010d76beecd7f869.tar.bz2 KVIrc-5433ecb1acedf35b266b3808010d76beecd7f869.zip | |
Make file.mkdir smarter
Diffstat (limited to 'src')
| -rw-r--r-- | src/modules/file/libkvifile.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/modules/file/libkvifile.cpp b/src/modules/file/libkvifile.cpp index 559af20b1..b52ea8e5f 100644 --- a/src/modules/file/libkvifile.cpp +++ b/src/modules/file/libkvifile.cpp @@ -79,7 +79,7 @@ Makes a copy of the <source> file as <destination>.[br] If the [-o] switch is used, the <destination> file is overwritten, if already exists.[br] With no [-o] switch, this command does not overwrite files.[br] - The destination path must be already existing: if you want to ensure this, use [fnc]$file.mkdir[/fnc] first.[br] + The destination path must be already existing: if you want to ensure this, use [cmd]file.mkdir[/cmd] first.[br] The paths (<source> and <destination>) are adjusted according to the system that KVIrc is running on so you don't have to bother about portability: it *should* be automatically guaranteed. Just use UNIX style paths for them.[br] @@ -356,7 +356,12 @@ static bool file_kvs_cmd_rename(KviKvsModuleCommandCall * c) @short: Creates a directory @syntax: - file.mkdir <directory:string> + file.mkdir [-q] [-e] <directory:string> + @switches: + !sw: -q | --quiet + Don't complain if the directory cannot be made + !sw: -e | --error + Fail completly if the directory cannot be made (will stop execution of the script) @description: Creates the <directory>.[br] The path is adjusted according to the system that KVIrc @@ -373,8 +378,12 @@ static bool file_kvs_cmd_mkdir(KviKvsModuleCommandCall * c) KVSM_PARAMETERS_END(c) KviFileUtils::adjustFilePath(szDir); if(!KviFileUtils::makeDir(szDir)) - c->warning(__tr2qs("Failed to make the directory '%Q'"),&szDir); - return true; + { + if(!c->switches()->find('q',"quiet")) + c->warning(__tr2qs("Failed to make the directory '%Q'"),&szDir); + + } + return !c->switches()->find('e',"error"); } /* |
