From e6014d8968a2328f569d717032912d83ef2795c7 Mon Sep 17 00:00:00 2001 From: bonni Date: Sat, 19 Aug 2023 00:20:11 +0200 Subject: [PATCH] adds documentation Signed-off-by: bonni --- man/nextcloudcmd.1.rst | 1 + src/cmd/cmd.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/man/nextcloudcmd.1.rst b/man/nextcloudcmd.1.rst index a78a99a2366e1..d673f1668be4f 100644 --- a/man/nextcloudcmd.1.rst +++ b/man/nextcloudcmd.1.rst @@ -43,6 +43,7 @@ OPTIONS ``—non-interactive`` Do not prompt for questions. + Tries to read $NC_USER and $NC_PASSWORD from the environment. ``—silent``, ``—s`` Inhibits verbose log output. diff --git a/src/cmd/cmd.cpp b/src/cmd/cmd.cpp index f3e7f39bf9431..a894ed639f4ff 100644 --- a/src/cmd/cmd.cpp +++ b/src/cmd/cmd.cpp @@ -186,7 +186,7 @@ void help() std::cout << " --user, -u [name] Use [name] as the login name" << 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 << " --non-interactive Do not block execution with interaction" << std::endl; + std::cout << " --non-interactive Do not block execution with interaction and tries to read $NC_USER and $NC_PASSWORD if not set by other means" << std::endl; std::cout << " --max-sync-retries [n] Retries maximum n times (default to 3)" << std::endl; std::cout << " --uplimit [n] Limit the upload speed of files to n KB/s" << std::endl; std::cout << " --downlimit [n] Limit the download speed of files to n KB/s" << std::endl; @@ -360,6 +360,7 @@ int main(int argc, char **argv) // 2. From options // 3. From netrc (if enabled) // 4. From prompt (if interactive) + // 4. From environment (if non-interactive) QString user = hostUrl.userName(); QString password = hostUrl.password();