[BACK]Return to cmd-show-environment.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/cmd-show-environment.c between version 1.4 and 1.5

version 1.4, 2011/04/05 19:37:01 version 1.5, 2012/03/22 11:11:57
Line 31 
Line 31 
   
 const struct cmd_entry cmd_show_environment_entry = {  const struct cmd_entry cmd_show_environment_entry = {
         "show-environment", "showenv",          "show-environment", "showenv",
         "gt:", 0, 0,          "gt:", 0, 1,
         "[-g] " CMD_TARGET_SESSION_USAGE,          "[-g] " CMD_TARGET_SESSION_USAGE " [name]",
         0,          0,
         NULL,          NULL,
         NULL,          NULL,
Line 53 
Line 53 
                 if ((s = cmd_find_session(ctx, args_get(args, 't'), 0)) == NULL)                  if ((s = cmd_find_session(ctx, args_get(args, 't'), 0)) == NULL)
                         return (-1);                          return (-1);
                 env = &s->environ;                  env = &s->environ;
           }
   
           if (args->argc != 0) {
                   envent = environ_find(env, args->argv[0]);
                   if (envent == NULL) {
                           ctx->error(ctx, "unknown variable: %s", args->argv[0]);
                           return (-1);
                   }
                   if (envent->value != NULL)
                           ctx->print(ctx, "%s=%s", envent->name, envent->value);
                   else
                           ctx->print(ctx, "-%s", envent->name);
                   return (0);
         }          }
   
         RB_FOREACH(envent, environ, env) {          RB_FOREACH(envent, environ, env) {

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5