From 469c96b6d2fe90f1adbe4b79a71c2918c0ff3622 Mon Sep 17 00:00:00 2001 From: Galen Getsov <4815620+ggetsov@users.noreply.github.com> Date: Sun, 30 Jun 2019 12:10:41 +0300 Subject: Add --verbose option --- sshfs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sshfs.c') diff --git a/sshfs.c b/sshfs.c index 06a1ef3..9175a2c 100644 --- a/sshfs.c +++ b/sshfs.c @@ -245,6 +245,7 @@ struct sshfs { int sync_read; int sync_readdir; int debug; + int verbose; int foreground; int reconnect; int delay_connect; @@ -398,6 +399,7 @@ static struct fuse_opt sshfs_opts[] = { SSHFS_OPT("no_readahead", sync_read, 1), SSHFS_OPT("sync_readdir", sync_readdir, 1), SSHFS_OPT("sshfs_debug", debug, 1), + SSHFS_OPT("sshfs_verbose", verbose, 1), SSHFS_OPT("reconnect", reconnect, 1), SSHFS_OPT("transform_symlinks", transform_symlinks, 1), SSHFS_OPT("follow_symlinks", follow_symlinks, 1), @@ -415,6 +417,8 @@ static struct fuse_opt sshfs_opts[] = { SSHFS_OPT("--version", show_version, 1), SSHFS_OPT("-d", debug, 1), SSHFS_OPT("debug", debug, 1), + SSHFS_OPT("-v", verbose, 1), + SSHFS_OPT("verbose", verbose, 1), SSHFS_OPT("-f", foreground, 1), SSHFS_OPT("-s", singlethread, 1), @@ -1037,7 +1041,7 @@ static int start_ssh(void) perror("failed to redirect input/output"); _exit(1); } - if (!sshfs.foreground && devnull != -1) + if (!sshfs.verbose && !sshfs.foreground && devnull != -1) dup2(devnull, 2); close(devnull); @@ -3357,6 +3361,7 @@ static void usage(const char *progname) " -o no_readahead synchronous reads (no speculative readahead)\n" " -o sync_readdir synchronous readdir\n" " -d, --debug print some debugging information (implies -f)\n" +" -v, --verbose print ssh replies and messages\n" " -o dir_cache=BOOL enable caching of directory contents (names,\n" " attributes, symlink targets) {yes,no} (default: yes)\n" " -o dcache_max_size=N sets the maximum size of the directory cache (default: 10000)\n" -- cgit v1.2.3