Skip to content

Commit

Permalink
Add --verbose option
Browse files Browse the repository at this point in the history
  • Loading branch information
ggets authored and Nikratio committed Jun 30, 2019
1 parent c448518 commit 469c96b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sshfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ struct sshfs {
int sync_read;
int sync_readdir;
int debug;
int verbose;
int foreground;
int reconnect;
int delay_connect;
Expand Down Expand Up @@ -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),
Expand All @@ -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),

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 469c96b

Please sign in to comment.