From 4927e48bf34fbbb639f602fe41927aa5519d2e9b Mon Sep 17 00:00:00 2001 From: allexzander Date: Fri, 20 Aug 2021 18:46:38 +0300 Subject: [PATCH] Update nextcloudcmd documentation. Signed-off-by: allexzander --- doc/nextcloudcmd.rst | 19 ++++++++----------- man/nextcloudcmd.1.rst | 19 ++++++++----------- src/cmd/cmd.cpp | 6 ------ 3 files changed, 16 insertions(+), 28 deletions(-) diff --git a/doc/nextcloudcmd.rst b/doc/nextcloudcmd.rst index a0630192c..7cd41f3ad 100644 --- a/doc/nextcloudcmd.rst +++ b/doc/nextcloudcmd.rst @@ -46,6 +46,9 @@ the server URL. Other command line switches supported by ``nextcloudcmd`` include the following: +``--path`` + Overrides default remote root folder to a specific subfolder on the server(e.g.: /Documents would sync the Documents subfolder on the server) + ``--user``, ``-u`` ``[user]`` Use ``user`` as the login name. @@ -67,12 +70,6 @@ Other command line switches supported by ``nextcloudcmd`` include the following: ``--httpproxy http://[user@pass:]:`` Uses ``server`` as HTTP proxy. -``--nonshib`` - Uses Non Shibboleth WebDAV Authentication - -``--davpath [path]`` - Overrides the WebDAV Path with ``path`` - ``--exclude [file]`` Exclude list file @@ -92,15 +89,15 @@ Credential Handling :: - $ nextcloudcmd /home/user/my_sync_folder https://carla:secret@server/nextcloud/remote.php/dav/ + $ nextcloudcmd /home/user/my_sync_folder https://carla:secret@server/nextcloud To synchronize the Nextcloud directory ``Music`` to the local directory ``media/music``, through a proxy listening on port ``8080``, and on a gateway machine using IP address ``192.168.178.1``, the command line would be:: - $ nextcloudcmd --httpproxy http://192.168.178.1:8080 \ + $ nextcloudcmd --httpproxy http://192.168.178.1:8080 --path /Music \ $HOME/media/music \ - https://server/nextcloud/remote.php/dav/Music + https://server/nextcloud ``nextcloudcmd`` will prompt for the user name and password, unless they have been specified on the command line or ``-n`` has been passed. @@ -120,5 +117,5 @@ Example :: - $ nextcloudcmd /home/user/ \ - https://:@/remote.php/dav/ + $ nextcloudcmd --path / /home/user/ \ + https://:@ diff --git a/man/nextcloudcmd.1.rst b/man/nextcloudcmd.1.rst index 84a95a65c..a78a99a23 100644 --- a/man/nextcloudcmd.1.rst +++ b/man/nextcloudcmd.1.rst @@ -24,11 +24,14 @@ The first parameter is the local directory. The second parameter is the server URL. .. note:: Prior to the 1.6 release of nextcloudcmd, the tool only accepted - ``nextcloud://`` or ``nextclouds://`` in place of ``http://`` and ``https://`` as + ``owncloud://`` or ``ownclouds://`` in place of ``http://`` and ``https://`` as a scheme. See ``Examples`` for details. OPTIONS ======= +``--path`` + Overrides default remote root folder to a specific subfolder on the server(e.g.: /Documents would sync the Documents subfolder on the server) + ``—user``, ``-u`` ``[user]`` Use ``user`` as the login name. @@ -50,12 +53,6 @@ OPTIONS ``—httpproxy http://[user@pass:]:`` Uses ``server`` as HTTP proxy. -``—nonshib`` - Uses Non Shibboleth WebDAV Authentication - -``—davpath [path]`` - Overrides the WebDAV Path with ``path`` - ``—exclude [file]`` Exclude list file @@ -74,18 +71,18 @@ To synchronize the nextCloud directory ``Music`` to the local directory ``media/ through a proxy listening on port ``8080`` on the gateway machine ``192.168.178.1``, the command line would be:: - $ nextcloudcmd —httpproxy http://192.168.178.1:8080 \ + $ nextcloudcmd —httpproxy http://192.168.178.1:8080 --path /Music \ $HOME/media/music \ - https://server/nextcloud/remote.php/dav/Music + https://server/nextcloud ``nextcloudcmd`` will enquire user name and password, unless they have been specified on the command line or ``-n`` (see `netrc(5)`) has been passed. Using the legacy scheme, it would be:: - $ nextcloudcmd —httpproxy http://192.168.178.1:8080 \ + $ nextcloudcmd —httpproxy http://192.168.178.1:8080 --path /Music \ $HOME/media/music \ - nextclouds://server/nextcloud/remote.php/dav/Music + ownclouds://server/nextcloud BUGS diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp index ca54a3427..db446abaa 100644 --- a/src/cmd/cmd.cpp +++ b/src/cmd/cmd.cpp @@ -78,7 +78,6 @@ struct CmdOptions bool ignoreHiddenFiles; QString exclude; QString unsyncedfolders; - QString davPath; int restartTimes; int downlimit; int uplimit; @@ -352,11 +351,6 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - // check if the dav path was added to the url and append if not. - if (!options.target_url.endsWith("/")) { - options.target_url.append("/"); - } - QUrl hostUrl = QUrl::fromUserInput(options.target_url); // Order of retrieval attempt (later attempts override earlier ones):