forgot my gitignore...

This commit is contained in:
Levi Neely 2024-06-25 01:38:26 +02:00
parent fbdd4910cd
commit 9659817dde
121 changed files with 21 additions and 116 deletions

21
.gitignore vendored Normal file
View File

@ -0,0 +1,21 @@
*.o
*.a
/pCloudCC/lib/pclsync/.cache/
/pCloudCC/lib/pclsync/compile_commands.json
/pCloudCC/lib/mbedtls/Makefile
/pCloudCC/lib/mbedtls/library/Makefile
/pCloudCC/CMakeCache.txt
/pCloudCC/CMakeFiles/
/pCloudCC/Makefile
/pCloudCC/cmake_install.cmake
/pCloudCC/*.so
/pCloudCC/pcloudcc
/pCloudCC/arch/*.log
/pCloudCC/arch/*.zst
/pCloudCC/arch/*.gz
/pCloudCC/install_manifest.txt
/pCloudCC/*.zst
a.out
pcloudcc
/pCloudCC/.cache/
/pCloudCC/compile_commands.json

View File

@ -1,116 +0,0 @@
#include "control_tools.h"
#include "pclsync_lib.h"
#include <boost/program_options.hpp>
#include <iostream>
namespace po = boost::program_options;
namespace ct = control_tools;
static std::string version = "2.0.1";
int main(int argc, char **argv) {
std::cout << "pCloud console client v." << version << std::endl;
std::string username;
std::string password;
bool daemon = false;
bool commands = false;
bool commands_only = false;
bool newuser = false;
bool passwordsw = false;
bool save_pass = false;
bool crypto = false;
try {
po::options_description desc("Allowed options");
desc.add_options()("help,h", "produce help message")(
"username,u", po::value<std::string>(&username),
"pCloud account name")("password,p", po::bool_switch(&passwordsw),
"Ask pCloud account password")(
"crypto,c", po::bool_switch(&crypto),
"Ask crypto password")("passascrypto,y", po::value<std::string>(),
"Use user password as crypto password also.")(
"daemonize,d", po::bool_switch(&daemon), "Daemonize the process.")(
"commands ,o", po::bool_switch(&commands),
"Parent stays alive and processes commands. ")(
"mountpoint,m", po::value<std::string>(),
"Mount point where drive to be mounted.")(
"commands_only,k", po::bool_switch(&commands_only),
"Daemon already started pass only commands")(
"newuser,n", po::bool_switch(&newuser),
"Switch if this is a new user to be registered.")(
"savepassword,s", po::bool_switch(&save_pass),
"Save password in database.");
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
po::notify(vm);
if (commands_only) {
ct::process_commands();
exit(0);
}
for (int i = 1; i < argc; ++i)
memset(argv[i], 0, strlen(argv[i]));
if (daemon) {
strncpy(argv[0], "pCloudDriveDeamon", strlen(argv[0]));
} else {
strncpy(argv[0], "pCloudDrive", strlen(argv[0]));
}
if (vm.count("help")) {
std::cout << desc << "\n";
return 0;
}
if ((!vm.count("username"))) {
std::cout << "Username option is required!!!"
<< "\n";
return 1;
}
console_client::clibrary::pclsync_lib::get_lib().set_username(username);
if (passwordsw) {
console_client::clibrary::pclsync_lib::get_lib().get_pass_from_console();
}
if (crypto) {
console_client::clibrary::pclsync_lib::get_lib().setup_crypto_ = true;
if (vm.count("passascrypto"))
console_client::clibrary::pclsync_lib::get_lib().set_crypto_pass(
password);
else {
std::cout << "Enter crypto password."
<< "\n";
console_client::clibrary::pclsync_lib::get_lib()
.get_cryptopass_from_console();
}
} else
console_client::clibrary::pclsync_lib::get_lib().setup_crypto_ = false;
if (vm.count("mountpoint"))
console_client::clibrary::pclsync_lib::get_lib().set_mount(
vm["mountpoint"].as<std::string>());
console_client::clibrary::pclsync_lib::get_lib().newuser_ = newuser;
console_client::clibrary::pclsync_lib::get_lib().set_savepass(save_pass);
console_client::clibrary::pclsync_lib::get_lib().set_daemon(daemon);
} catch (std::exception &e) {
std::cerr << "error: " << e.what() << "\n";
return 1;
} catch (...) {
std::cerr << "Exception of unknown type!\n";
}
if (daemon)
ct::daemonize(commands);
else {
if (commands)
std::cout << "Option commnads/o ignored."
<< "\n";
if (!console_client::clibrary::pclsync_lib::get_lib().init())
sleep(360000);
}
return 0;
}

Some files were not shown because too many files have changed in this diff Show More