Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6a706392a6 |
1 changed files with 7 additions and 0 deletions
7
nuke.cpp
7
nuke.cpp
|
@ -9,12 +9,19 @@ for(int i=1;i<argc;i++){
|
||||||
if (string(argv[i]) == "-v")
|
if (string(argv[i]) == "-v")
|
||||||
{
|
{
|
||||||
cout<<"patricus utils, version "+string(VERSION);
|
cout<<"patricus utils, version "+string(VERSION);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
if(!filesystem::exists(argv[i]))
|
if(!filesystem::exists(argv[i]))
|
||||||
{
|
{
|
||||||
cerr<<"error, no such file or directory";
|
cerr<<"error, no such file or directory";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
filesystem::remove_all(argv[i]);
|
filesystem::remove_all(argv[i]);
|
||||||
}
|
}
|
||||||
|
catch(std::filesystem::filesystem_error){
|
||||||
|
cout<<"error: permission denied";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue