diff options
-rw-r--r-- | ssh-bleach.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ssh-bleach.c b/ssh-bleach.c index d0cab2b..4b3c3b3 100644 --- a/ssh-bleach.c +++ b/ssh-bleach.c @@ -22,8 +22,11 @@ #include <string.h> #include <unistd.h> +int verbose = 0; + int cvs_server (char *line) { - printf ("cvs server\n"); + if (verbose) + printf ("cvs server\n"); return execl ("/usr/bin/cvs", "cvs", "server", NULL); } @@ -50,7 +53,8 @@ char *get_quoted_arg (char *line) *n++ = *old; } *n++ = '\0'; - printf ("First argument is \"%s\"\n", new); + if (verbose) + printf ("First argument is \"%s\"\n", new); return new; } @@ -59,7 +63,8 @@ int git_receive_pack (char *line) { if (! arg) return 0; - printf ("git-receive-pack '%s'\n", arg); + if (verbose) + printf ("git-receive-pack '%s'\n", arg); return execl ("/usr/local/bin/git-receive-pack", "git-receive-pack", arg, @@ -71,7 +76,8 @@ int git_upload_pack (char *line) { if (! arg) return 0; - printf ("git-upload-pack '%s'\n", arg); + if (verbose) + printf ("git-upload-pack '%s'\n", arg); return execl ("/usr/local/bin/git-upload-pack", "git-upload-pack", arg, @@ -93,6 +99,8 @@ int main (int argc, char **argv) char *line = getenv ("SSH_ORIGINAL_COMMAND"); int i; + if (argv[1] && !strcmp (argv[1], "-v")) + verbose = 1; if (!line) return 1; for (i = 0; commands[i].name; i++) |