27 lines
No EOL
470 B
C++
27 lines
No EOL
470 B
C++
#include<version.h>
|
|
#include<string>
|
|
#include<filesystem>
|
|
#include<iostream>
|
|
using namespace std;
|
|
int main(int argc, char* argv[])
|
|
{
|
|
for(int i=1;i<argc;i++){
|
|
if (string(argv[i]) == "-v")
|
|
{
|
|
cout<<"patricus utils, version "+string(VERSION);
|
|
return 0;
|
|
}
|
|
if(!filesystem::exists(argv[i]))
|
|
{
|
|
cerr<<"error, no such file or directory";
|
|
return 1;
|
|
}
|
|
try
|
|
{
|
|
filesystem::remove_all(argv[i]);
|
|
}
|
|
catch(std::filesystem::filesystem_error){
|
|
cout<<"error: permission denied";
|
|
}
|
|
}
|
|
} |