From 1aa17cdb69fb27b912f87688d42b46419e3789dd Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Wed, 15 Jul 2015 11:30:50 +0200 Subject: [PATCH] owncloudcmd: add option to not ignore hidden files. --- src/cmd/cmd.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp index d24418d83..a75be0451 100644 --- a/src/cmd/cmd.cpp +++ b/src/cmd/cmd.cpp @@ -55,6 +55,7 @@ struct CmdOptions { bool trustSSL; bool useNetrc; bool interactive; + bool ignoreHiddenFiles; QString exclude; QString unsyncedfolders; }; @@ -154,6 +155,7 @@ void help() std::cout << " --password, -p [pass] Use [pass] as password" << 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 << " -h Sync hidden files,do not ignore them" << std::endl; std::cout << " --version, -v Display version and exit" << std::endl; std::cout << "" << std::endl; exit(1); @@ -216,6 +218,8 @@ void parseOptions( const QStringList& app_args, CmdOptions *options ) options->trustSSL = true; } else if( option == "-n") { options->useNetrc = true; + } else if( option == "-h") { + options->ignoreHiddenFiles = false; } else if( option == "--non-interactive") { options->interactive = false; } else if( (option == "-u" || option == "--user") && !it.peekNext().startsWith("-") ) { @@ -269,6 +273,7 @@ int main(int argc, char **argv) { options.trustSSL = false; options.useNetrc = false; options.interactive = true; + options.ignoreHiddenFiles = true; ClientProxy clientProxy; parseOptions( app.arguments(), &options ); @@ -364,6 +369,9 @@ restart_sync: 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); if( !options.proxy.isNull() ) { QString host;