owncloudcmd: add option to not ignore hidden files.

This commit is contained in:
Klaas Freitag 2015-07-15 11:30:50 +02:00
parent ddf7419aca
commit 1aa17cdb69

View file

@ -55,6 +55,7 @@ struct CmdOptions {
bool trustSSL; bool trustSSL;
bool useNetrc; bool useNetrc;
bool interactive; bool interactive;
bool ignoreHiddenFiles;
QString exclude; QString exclude;
QString unsyncedfolders; QString unsyncedfolders;
}; };
@ -154,6 +155,7 @@ void help()
std::cout << " --password, -p [pass] Use [pass] as password" << std::endl; std::cout << " --password, -p [pass] Use [pass] as password" << std::endl;
std::cout << " -n Use netrc (5) for login" << std::endl; std::cout << " -n Use netrc (5) for login" << std::endl;
std::cout << " --non-interactive Do not block execution with interaction" << std::endl; std::cout << " --non-interactive Do not block execution with interaction" << std::endl;
std::cout << " -h Sync hidden files,do not ignore them" << std::endl;
std::cout << " --version, -v Display version and exit" << std::endl; std::cout << " --version, -v Display version and exit" << std::endl;
std::cout << "" << std::endl; std::cout << "" << std::endl;
exit(1); exit(1);
@ -216,6 +218,8 @@ void parseOptions( const QStringList& app_args, CmdOptions *options )
options->trustSSL = true; options->trustSSL = true;
} else if( option == "-n") { } else if( option == "-n") {
options->useNetrc = true; options->useNetrc = true;
} else if( option == "-h") {
options->ignoreHiddenFiles = false;
} else if( option == "--non-interactive") { } else if( option == "--non-interactive") {
options->interactive = false; options->interactive = false;
} else if( (option == "-u" || option == "--user") && !it.peekNext().startsWith("-") ) { } else if( (option == "-u" || option == "--user") && !it.peekNext().startsWith("-") ) {
@ -269,6 +273,7 @@ int main(int argc, char **argv) {
options.trustSSL = false; options.trustSSL = false;
options.useNetrc = false; options.useNetrc = false;
options.interactive = true; options.interactive = true;
options.ignoreHiddenFiles = true;
ClientProxy clientProxy; ClientProxy clientProxy;
parseOptions( app.arguments(), &options ); parseOptions( app.arguments(), &options );
@ -364,6 +369,9 @@ restart_sync:
return EXIT_FAILURE; return EXIT_FAILURE;
} }
// ignore hidden files or not
_csync_ctx->ignore_hidden_files = options.ignoreHiddenFiles;
csync_set_module_property(_csync_ctx, "csync_context", _csync_ctx); csync_set_module_property(_csync_ctx, "csync_context", _csync_ctx);
if( !options.proxy.isNull() ) { if( !options.proxy.isNull() ) {
QString host; QString host;