commands/vchforwards.cc
changeset 2 b3afb9f1e801
parent 0 6f7a81934006
equal deleted inserted replaced
1:30113bfbe723 2:b3afb9f1e801
    16 
    16 
    17 #include <config.h>
    17 #include <config.h>
    18 #include "fdbuf/fdbuf.h"
    18 #include "fdbuf/fdbuf.h"
    19 #include "mystring/mystring.h"
    19 #include "mystring/mystring.h"
    20 #include "config/configrc.h"
    20 #include "config/configrc.h"
    21 #include "cli/cli.h"
    21 #include "cli++/cli++.h"
    22 #include "vcommand.h"
    22 #include "vcommand.h"
    23 
    23 
    24 const char* cli_program = "vchforwards";
    24 const char* cli_program = "vchforwards";
    25 const char* cli_help_prefix =
    25 const char* cli_help_prefix =
    26 "Change virtual user forwarding addresses.\n";
    26 "Change virtual user forwarding addresses.\n";
    27 const char* cli_help_suffix =
    27 const char* cli_help_suffix =
    28 "If no forwarding addresses are given, forwarding is disabled.
    28 "If no forwarding addresses are given, forwarding is disabled.\n";
    29 ";
       
    30 const char* cli_args_usage = "USERNAME [DESTINATION1 ...]";
    29 const char* cli_args_usage = "USERNAME [DESTINATION1 ...]";
    31 const int cli_args_min = 1;
    30 const int cli_args_min = 1;
    32 const int cli_args_max = -1;
    31 const int cli_args_max = -1;
    33 
    32 
    34 static int o_quiet = false;
    33 static int o_quiet = false;
    52     return 1;
    51     return 1;
    53 
    52 
    54   mystring username = argv[0];
    53   mystring username = argv[0];
    55   username = username.lower();
    54   username = username.lower();
    56   
    55   
    57   vpwentry* vpw = domain.lookup(username, false);
    56   vpwentry* vpw = domain.lookup(username);
    58   if(!vpw) {
    57   if(!vpw) {
    59     if(!o_quiet)
    58     if(!o_quiet)
    60       ferr << "vchforwards: User '" << username << "' does not exist." << endl;
    59       ferr << "vchforwards: User '" << username << "' does not exist." << endl;
    61     return 1;
    60     return 1;
    62   }
    61   }