~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzle.cc

  • Committer: lbieber
  • Date: 2010-08-30 04:29:47 UTC
  • mfrom: (1737.1.1 build)
  • Revision ID: lbieber@orisndriz03-20100830042947-wzt2t7c49ehkkduh
Merge Andrew - Lots of cleanups to the drizzle and drizzledump code

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
using namespace std;
163
163
namespace po=boost::program_options;
164
164
 
165
 
const string VER("14.14");
166
165
/* Don't try to make a nice table if the data is too big */
167
166
const uint32_t MAX_COLUMN_LENGTH= 1024;
168
167
 
1222
1221
 
1223
1222
  if (verbose)
1224
1223
  {
1225
 
    printf("shutting down drizzled");
 
1224
    printf(_("shutting down drizzled"));
1226
1225
    if (opt_drizzle_port > 0)
1227
 
      printf(" on port %d", opt_drizzle_port);
 
1226
      printf(_(" on port %d"), opt_drizzle_port);
1228
1227
    printf("... ");
1229
1228
  }
1230
1229
 
1233
1232
  {
1234
1233
    if (ret == DRIZZLE_RETURN_ERROR_CODE)
1235
1234
    {
1236
 
      fprintf(stderr, "shutdown failed; error: '%s'",
 
1235
      fprintf(stderr, _("shutdown failed; error: '%s'"),
1237
1236
              drizzle_result_error(&result));
1238
1237
      drizzle_result_free(&result);
1239
1238
    }
1240
1239
    else
1241
1240
    {
1242
 
      fprintf(stderr, "shutdown failed; error: '%s'",
 
1241
      fprintf(stderr, _("shutdown failed; error: '%s'"),
1243
1242
              drizzle_con_error(&con));
1244
1243
    }
1245
1244
    return false;
1248
1247
  drizzle_result_free(&result);
1249
1248
 
1250
1249
  if (verbose)
1251
 
    printf("done\n");
 
1250
    printf(_("done\n"));
1252
1251
 
1253
1252
  return true;
1254
1253
}
1269
1268
  if (drizzle_ping(&con, &result, &ret) != NULL && ret == DRIZZLE_RETURN_OK)
1270
1269
  {
1271
1270
    if (opt_silent < 2)
1272
 
      printf("drizzled is alive\n");
 
1271
      printf(_("drizzled is alive\n"));
1273
1272
  }
1274
1273
  else
1275
1274
  {
1276
1275
    if (ret == DRIZZLE_RETURN_ERROR_CODE)
1277
1276
    {
1278
 
      fprintf(stderr, "ping failed; error: '%s'",
 
1277
      fprintf(stderr, _("ping failed; error: '%s'"),
1279
1278
              drizzle_result_error(&result));
1280
1279
      drizzle_result_free(&result);
1281
1280
    }
1282
1281
    else
1283
1282
    {
1284
 
      fprintf(stderr, "drizzled won't answer to ping, error: '%s'",
 
1283
      fprintf(stderr, _("drizzled won't answer to ping, error: '%s'"),
1285
1284
              drizzle_con_error(&con));
1286
1285
    }
1287
1286
    return false;
1330
1329
  opt_connect_timeout= 0;
1331
1330
  if (in_connect_timeout > 3600*12)
1332
1331
  {
1333
 
    cout << N_("Error: Invalid Value for connect_timeout"); 
 
1332
    cout << _("Error: Invalid Value for connect_timeout"); 
1334
1333
    exit(-1);
1335
1334
  }
1336
1335
  opt_connect_timeout= in_connect_timeout;
1341
1340
  opt_max_input_line= 0;
1342
1341
  if (in_max_input_line < 4096 || in_max_input_line > (int64_t)2*1024L*1024L*1024L)
1343
1342
  {
1344
 
    cout << N_("Error: Invalid Value for max_input_line");
 
1343
    cout << _("Error: Invalid Value for max_input_line");
1345
1344
    exit(-1);
1346
1345
  }
1347
1346
  opt_max_input_line= in_max_input_line - (in_max_input_line % 1024);
1351
1350
{
1352
1351
try
1353
1352
{
 
1353
 
1354
1354
#if defined(ENABLE_NLS)
1355
1355
# if defined(HAVE_LOCALE_H)
1356
1356
  setlocale(LC_ALL, "");
1359
1359
  textdomain("drizzle");
1360
1360
#endif
1361
1361
 
1362
 
  po::options_description commandline_options("Options used only in command line");
 
1362
  po::options_description commandline_options(N_("Options used only in command line"));
1363
1363
  commandline_options.add_options()
1364
1364
  ("help,?",N_("Displays this help and exit."))
1365
1365
  ("batch,B",N_("Don't use history file. Disable interactive behavior. (Enables --silent)"))
1411
1411
  N_("Configuration file defaults are not used if no-defaults is set"))
1412
1412
  ;
1413
1413
 
1414
 
  po::options_description drizzle_options("Options specific to the drizzle client");
 
1414
  po::options_description drizzle_options(N_("Options specific to the drizzle client"));
1415
1415
  drizzle_options.add_options()
1416
1416
  ("auto-rehash", po::value<bool>(&opt_rehash)->default_value(true)->zero_tokens(),
1417
1417
  N_("Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash."))
1464
1464
  N_("Automatic limit for rows in a join when using --safe-updates"))
1465
1465
  ;
1466
1466
 
1467
 
  po::options_description client_options("Options specific to the client");
 
1467
  po::options_description client_options(N_("Options specific to the client"));
1468
1468
  client_options.add_options()
1469
1469
  ("mysql,m", po::value<bool>(&opt_mysql)->default_value(true)->zero_tokens(),
1470
1470
  N_("Use MySQL Protocol."))
1480
1480
  N_("The protocol of connection (tcp,socket,pipe,memory)."))
1481
1481
  ;
1482
1482
 
1483
 
  po::options_description long_options("Allowed Options");
 
1483
  po::options_description long_options(N_("Allowed Options"));
1484
1484
  long_options.add(commandline_options).add(drizzle_options).add(client_options);
1485
1485
 
1486
1486
  std::string system_config_dir_drizzle(SYSCONFDIR); 
1705
1705
  {
1706
1706
    opt_silent++;
1707
1707
  }
1708
 
  if (vm.count("version"))
1709
 
  {
1710
 
    printf(_("drizzle  Ver %s Distrib %s, for %s-%s (%s) using readline %s\n"),
1711
 
           VER.c_str(), drizzle_version(),
1712
 
           HOST_VENDOR, HOST_OS, HOST_CPU,
1713
 
           rl_library_version);
1714
 
 
1715
 
    exit(0);
1716
 
  }
1717
1708
  
1718
 
  if (vm.count("help"))
 
1709
  if (vm.count("help") || vm.count("version"))
1719
1710
  {
1720
 
    printf(_("drizzle  Ver %s Distrib %s, for %s-%s (%s) using readline %s\n"),
1721
 
           VER.c_str(), drizzle_version(),
 
1711
    printf(_("Drizzle client %s build %s, for %s-%s (%s) using readline %s\n"),
 
1712
           drizzle_version(), VERSION,
1722
1713
           HOST_VENDOR, HOST_OS, HOST_CPU,
1723
1714
           rl_library_version);
 
1715
    if (vm.count("version"))
 
1716
      exit(0);
1724
1717
    printf(_("Copyright (C) 2008 Sun Microsystems\n"
1725
1718
           "This software comes with ABSOLUTELY NO WARRANTY. "
1726
1719
           "This is free software,\n"
1727
1720
           "and you are welcome to modify and redistribute it "
1728
1721
           "under the GPL license\n"));
1729
1722
    printf(_("Usage: drizzle [OPTIONS] [database]\n"));
1730
 
    cout<<long_options;
 
1723
    cout << long_options;
1731
1724
    exit(0);
1732
1725
  }
1733
1726
 
1842
1835
 
1843
1836
  catch(exception &err)
1844
1837
  {
1845
 
  cerr<<"Error:"<<err.what()<<endl;
 
1838
    cerr << _("Error:") << err.what() << endl;
1846
1839
  }
1847
1840
  return(0);        // Keep compiler happy
1848
1841
}
3006
2999
  {
3007
3000
    if (!(PAGER= popen(pager.c_str(), "w")))
3008
3001
    {
3009
 
      tee_fprintf(stdout, "popen() failed! defaulting PAGER to stdout!\n");
 
3002
      tee_fprintf(stdout,_( "popen() failed! defaulting PAGER to stdout!\n"));
3010
3003
      PAGER= stdout;
3011
3004
    }
3012
3005
  }
3028
3021
    end_tee();
3029
3022
  if (!(new_outfile= fopen(file_name, "a")))
3030
3023
  {
3031
 
    tee_fprintf(stdout, "Error logging to file '%s'\n", file_name);
 
3024
    tee_fprintf(stdout, _("Error logging to file '%s'\n"), file_name);
3032
3025
    return;
3033
3026
  }
3034
3027
  OUTFILE = new_outfile;
3035
3028
  outfile.assign(file_name);
3036
 
  tee_fprintf(stdout, "Logging to file '%s'\n", file_name);
 
3029
  tee_fprintf(stdout, _("Logging to file '%s'\n"), file_name);
3037
3030
  opt_outfile= 1;
3038
3031
 
3039
3032
  return;
3117
3110
 
3118
3111
  while ((field = drizzle_column_next(result)))
3119
3112
  {
3120
 
    tee_fprintf(PAGER, "Field %3u:  `%s`\n"
 
3113
    tee_fprintf(PAGER, _("Field %3u:  `%s`\n"
3121
3114
                "Catalog:    `%s`\n"
3122
3115
                "Database:   `%s`\n"
3123
3116
                "Table:      `%s`\n"
3127
3120
                "Length:     %lu\n"
3128
3121
                "Max_length: %lu\n"
3129
3122
                "Decimals:   %u\n"
3130
 
                "Flags:      %s\n\n",
 
3123
                "Flags:      %s\n\n"),
3131
3124
                ++i,
3132
3125
                drizzle_column_name(field), drizzle_column_catalog(field),
3133
3126
                drizzle_column_db(field), drizzle_column_table(field),
3584
3577
  {
3585
3578
    if (outfile.empty())
3586
3579
    {
3587
 
      printf("No previous outfile available, you must give a filename!\n");
 
3580
      printf(_("No previous outfile available, you must give a filename!\n"));
3588
3581
      return 0;
3589
3582
    }
3590
3583
    else if (opt_outfile)
3591
3584
    {
3592
 
      tee_fprintf(stdout, "Currently logging to file '%s'\n", outfile.c_str());
 
3585
      tee_fprintf(stdout, _("Currently logging to file '%s'\n"), outfile.c_str());
3593
3586
      return 0;
3594
3587
    }
3595
3588
    else
3609
3602
  end[0]= 0;
3610
3603
  if (end == file_name)
3611
3604
  {
3612
 
    printf("No outfile specified!\n");
 
3605
    printf(_("No outfile specified!\n"));
3613
3606
    return 0;
3614
3607
  }
3615
3608
  init_tee(file_name);
3622
3615
{
3623
3616
  if (opt_outfile)
3624
3617
    end_tee();
3625
 
  tee_fprintf(stdout, "Outfile disabled.\n");
 
3618
  tee_fprintf(stdout, _("Outfile disabled.\n"));
3626
3619
  return 0;
3627
3620
}
3628
3621
 
3649
3642
  {
3650
3643
    if (!default_pager_set)
3651
3644
    {
3652
 
      tee_fprintf(stdout, "Default pager wasn't set, using stdout.\n");
 
3645
      tee_fprintf(stdout, _("Default pager wasn't set, using stdout.\n"));
3653
3646
      opt_nopager=1;
3654
3647
      pager.assign("stdout");
3655
3648
      PAGER= stdout;
3669
3662
    default_pager.assign(pager_name);
3670
3663
  }
3671
3664
  opt_nopager=0;
3672
 
  tee_fprintf(stdout, "PAGER set to '%s'\n", pager.c_str());
 
3665
  tee_fprintf(stdout, _("PAGER set to '%s'\n"), pager.c_str());
3673
3666
  return 0;
3674
3667
}
3675
3668
 
3680
3673
  pager.assign("stdout");
3681
3674
  opt_nopager=1;
3682
3675
  PAGER= stdout;
3683
 
  tee_fprintf(stdout, "PAGER set to stdout\n");
 
3676
  tee_fprintf(stdout, _("PAGER set to stdout\n"));
3684
3677
  return 0;
3685
3678
}
3686
3679
 
3763
3756
 
3764
3757
  if (connected)
3765
3758
  {
3766
 
    sprintf(buff,"Connection id:    %u",drizzle_con_thread_id(&con));
 
3759
    sprintf(buff, _("Connection id:    %u"), drizzle_con_thread_id(&con));
3767
3760
    put_info(buff,INFO_INFO,0,0);
3768
 
    sprintf(buff,"Current database: %.128s\n",
3769
 
            !current_db.empty() ? current_db.c_str() : "*** NONE ***");
 
3761
    sprintf(buff, _("Current database: %.128s\n"),
 
3762
            !current_db.empty() ? current_db.c_str() : _("*** NONE ***"));
3770
3763
    put_info(buff,INFO_INFO,0,0);
3771
3764
  }
3772
3765
  return error;
3786
3779
  while (isspace(*line))
3787
3780
    line++;
3788
3781
  if (!(param = strchr(line, ' ')))    // Skip command name
3789
 
    return put_info("Usage: \\. <filename> | source <filename>",
 
3782
    return put_info(_("Usage: \\. <filename> | source <filename>"),
3790
3783
                    INFO_ERROR, 0,0);
3791
3784
  while (isspace(*param))
3792
3785
    param++;
3801
3794
  if (!(sql_file = fopen(source_name, "r")))
3802
3795
  {
3803
3796
    char buff[FN_REFLEN+60];
3804
 
    sprintf(buff,"Failed to open file '%s', error: %d", source_name,errno);
 
3797
    sprintf(buff, _("Failed to open file '%s', error: %d"), source_name,errno);
3805
3798
    return put_info(buff, INFO_ERROR, 0 ,0);
3806
3799
  }
3807
3800
 
3809
3802
  if (line_buff == NULL)
3810
3803
  {
3811
3804
    fclose(sql_file);
3812
 
    return put_info("Can't initialize LineBuffer", INFO_ERROR, 0, 0);
 
3805
    return put_info(_("Can't initialize LineBuffer"), INFO_ERROR, 0, 0);
3813
3806
  }
3814
3807
 
3815
3808
  /* Save old status */
3845
3838
 
3846
3839
  if (!tmp || !*tmp)
3847
3840
  {
3848
 
    put_info("DELIMITER must be followed by a 'delimiter' character or string",
 
3841
    put_info(_("DELIMITER must be followed by a 'delimiter' character or string"),
3849
3842
             INFO_ERROR, 0, 0);
3850
3843
    return 0;
3851
3844
  }
3853
3846
  {
3854
3847
    if (strstr(tmp, "\\"))
3855
3848
    {
3856
 
      put_info("DELIMITER cannot contain a backslash character",
 
3849
      put_info(_("DELIMITER cannot contain a backslash character"),
3857
3850
               INFO_ERROR, 0, 0);
3858
3851
      return 0;
3859
3852
    }
3878
3871
  tmp= get_arg(buff, 0);
3879
3872
  if (!tmp || !*tmp)
3880
3873
  {
3881
 
    put_info("USE must be followed by a database name", INFO_ERROR, 0, 0);
 
3874
    put_info(_("USE must be followed by a database name"), INFO_ERROR, 0, 0);
3882
3875
    return 0;
3883
3876
  }
3884
3877
  /*
3946
3939
      build_completion_hash(opt_rehash, 1);
3947
3940
  }
3948
3941
 
3949
 
  put_info("Database changed",INFO_INFO, 0, 0);
 
3942
  put_info(_("Database changed"),INFO_INFO, 0, 0);
3950
3943
  return 0;
3951
3944
}
3952
3945
 
3954
3947
com_warnings(string *, const char *)
3955
3948
{
3956
3949
  show_warnings = 1;
3957
 
  put_info("Show warnings enabled.",INFO_INFO, 0, 0);
 
3950
  put_info(_("Show warnings enabled."),INFO_INFO, 0, 0);
3958
3951
  return 0;
3959
3952
}
3960
3953
 
3962
3955
com_nowarnings(string *, const char *)
3963
3956
{
3964
3957
  show_warnings = 0;
3965
 
  put_info("Show warnings disabled.",INFO_INFO, 0, 0);
 
3958
  put_info(_("Show warnings disabled."),INFO_INFO, 0, 0);
3966
3959
  return 0;
3967
3960
}
3968
3961
 
4097
4090
  drizzle_return_t ret;
4098
4091
 
4099
4092
  tee_puts("--------------", stdout);
4100
 
  printf(_("drizzle  Ver %s Distrib %s, for %s-%s (%s) using readline %s\n"),
4101
 
  VER.c_str(), drizzle_version(),
4102
 
  HOST_VENDOR, HOST_OS, HOST_CPU,
4103
 
  rl_library_version);          /* Print version */
4104
 
 
 
4093
  printf(_("Drizzle client %s build %s, for %s-%s (%s) using readline %s\n"),
 
4094
         drizzle_version(), VERSION,
 
4095
         HOST_VENDOR, HOST_OS,
 
4096
         rl_library_version);
4105
4097
 
4106
4098
  if (connected)
4107
4099
  {
4108
 
    tee_fprintf(stdout, "\nConnection id:\t\t%lu\n",drizzle_con_thread_id(&con));
 
4100
    tee_fprintf(stdout, _("\nConnection id:\t\t%lu\n"),drizzle_con_thread_id(&con));
4109
4101
    /*
4110
4102
      Don't remove "limit 1",
4111
4103
      it is protection againts SQL_SELECT_LIMIT=0
4117
4109
      drizzle_row_t cur=drizzle_row_next(&result);
4118
4110
      if (cur)
4119
4111
      {
4120
 
        tee_fprintf(stdout, "Current database:\t%s\n", cur[0] ? cur[0] : "");
4121
 
        tee_fprintf(stdout, "Current user:\t\t%s\n", cur[1]);
 
4112
        tee_fprintf(stdout, _("Current database:\t%s\n"), cur[0] ? cur[0] : "");
 
4113
        tee_fprintf(stdout, _("Current user:\t\t%s\n"), cur[1]);
4122
4114
      }
4123
4115
      drizzle_result_free(&result);
4124
4116
    }
4125
4117
    else if (ret == DRIZZLE_RETURN_ERROR_CODE)
4126
4118
      drizzle_result_free(&result);
4127
 
    tee_puts("SSL:\t\t\tNot in use", stdout);
 
4119
    tee_puts(_("SSL:\t\t\tNot in use"), stdout);
4128
4120
  }
4129
4121
  else
4130
4122
  {
4131
4123
    vidattr(A_BOLD);
4132
 
    tee_fprintf(stdout, "\nNo connection\n");
 
4124
    tee_fprintf(stdout, _("\nNo connection\n"));
4133
4125
    vidattr(A_NORMAL);
4134
4126
    return 0;
4135
4127
  }
4136
4128
  if (skip_updates)
4137
4129
  {
4138
4130
    vidattr(A_BOLD);
4139
 
    tee_fprintf(stdout, "\nAll updates ignored to this database\n");
 
4131
    tee_fprintf(stdout, _("\nAll updates ignored to this database\n"));
4140
4132
    vidattr(A_NORMAL);
4141
4133
  }
4142
 
  tee_fprintf(stdout, "Current pager:\t\t%s\n", pager.c_str());
4143
 
  tee_fprintf(stdout, "Using outfile:\t\t'%s'\n", opt_outfile ? outfile.c_str() : "");
4144
 
  tee_fprintf(stdout, "Using delimiter:\t%s\n", delimiter);
4145
 
  tee_fprintf(stdout, "Server version:\t\t%s\n", server_version_string(&con));
4146
 
  tee_fprintf(stdout, "Protocol version:\t%d\n", drizzle_con_protocol_version(&con));
4147
 
  tee_fprintf(stdout, "Connection:\t\t%s\n", drizzle_con_host(&con));
 
4134
  tee_fprintf(stdout, _("Current pager:\t\t%s\n"), pager.c_str());
 
4135
  tee_fprintf(stdout, _("Using outfile:\t\t'%s'\n"), opt_outfile ? outfile.c_str() : "");
 
4136
  tee_fprintf(stdout, _("Using delimiter:\t%s\n"), delimiter);
 
4137
  tee_fprintf(stdout, _("Server version:\t\t%s\n"), server_version_string(&con));
 
4138
  tee_fprintf(stdout, _("Protocol version:\t%d\n"), drizzle_con_protocol_version(&con));
 
4139
  tee_fprintf(stdout, _("Connection:\t\t%s\n"), drizzle_con_host(&con));
4148
4140
/* XXX need to save this from result
4149
4141
  if ((id= drizzleclient_insert_id(&drizzle)))
4150
4142
    tee_fprintf(stdout, "Insert id:\t\t%s\n", internal::llstr(id, buff));
4151
4143
*/
4152
4144
 
4153
4145
  if (drizzle_con_uds(&con))
4154
 
    tee_fprintf(stdout, "UNIX socket:\t\t%s\n", drizzle_con_uds(&con));
 
4146
    tee_fprintf(stdout, _("UNIX socket:\t\t%s\n"), drizzle_con_uds(&con));
4155
4147
  else
4156
 
    tee_fprintf(stdout, "TCP port:\t\t%d\n", drizzle_con_port(&con));
 
4148
    tee_fprintf(stdout, _("TCP port:\t\t%d\n"), drizzle_con_port(&con));
4157
4149
 
4158
4150
  if (safe_updates)
4159
4151
  {
4160
4152
    vidattr(A_BOLD);
4161
 
    tee_fprintf(stdout, "\nNote that you are running in safe_update_mode:\n");
 
4153
    tee_fprintf(stdout, _("\nNote that you are running in safe_update_mode:\n"));
4162
4154
    vidattr(A_NORMAL);
4163
 
    tee_fprintf(stdout, "\
 
4155
    tee_fprintf(stdout, _("\
4164
4156
UPDATEs and DELETEs that don't use a key in the WHERE clause are not allowed.\n\
4165
4157
(One can force an UPDATE/DELETE by adding LIMIT # at the end of the command.)\n \
4166
4158
SELECT has an automatic 'LIMIT %lu' if LIMIT is not used.\n             \
4167
 
Max number of examined row combination in a join is set to: %lu\n\n",
 
4159
Max number of examined row combination in a join is set to: %lu\n\n"),
4168
4160
                select_limit, max_join_size);
4169
4161
  }
4170
4162
  tee_puts("--------------\n", stdout);
4222
4214
    if (info_type == INFO_ERROR)
4223
4215
    {
4224
4216
      (void) fflush(file);
4225
 
      fprintf(file,"ERROR");
 
4217
      fprintf(file,_("ERROR"));
4226
4218
      if (error)
4227
4219
      {
4228
4220
        if (sqlstate)
4265
4257
      if (error)
4266
4258
      {
4267
4259
        if (sqlstate)
4268
 
          (void) tee_fprintf(file, "ERROR %d (%s): ", error, sqlstate);
 
4260
          (void) tee_fprintf(file, _("ERROR %d (%s): "), error, sqlstate);
4269
4261
        else
4270
 
          (void) tee_fprintf(file, "ERROR %d: ", error);
 
4262
          (void) tee_fprintf(file, _("ERROR %d: "), error);
4271
4263
      }
4272
4264
      else
4273
 
        tee_puts("ERROR: ", file);
 
4265
        tee_puts(_("ERROR: "), file);
4274
4266
    }
4275
4267
    else
4276
4268
      vidattr(A_BOLD);
4403
4395
    tmp_buff_str << tmp;
4404
4396
 
4405
4397
    if (tmp > 1)
4406
 
      tmp_buff_str << " hours ";
 
4398
      tmp_buff_str << _(" hours ");
4407
4399
    else
4408
 
      tmp_buff_str << " hour ";
 
4400
      tmp_buff_str << _(" hour ");
4409
4401
  }
4410
4402
  if (sec >= 60.0)
4411
4403
  {
4412
4404
    tmp=(uint32_t) floor(sec/60.0);
4413
4405
    sec-=60.0*tmp;
4414
 
    tmp_buff_str << tmp << " min ";
 
4406
    tmp_buff_str << tmp << _(" min ");
4415
4407
  }
4416
4408
  if (part_second)
4417
4409
    tmp_buff_str.precision(2);
4418
4410
  else
4419
4411
    tmp_buff_str.precision(0);
4420
 
  tmp_buff_str << sec << " sec";
 
4412
  tmp_buff_str << sec << _(" sec");
4421
4413
  strcpy(buff, tmp_buff_str.str().c_str());
4422
4414
}
4423
4415
 
4518
4510
        if (!full_username)
4519
4511
          init_username();
4520
4512
        processed_prompt->append(part_username ? part_username :
4521
 
                                 (!current_user.empty() ?  current_user : "(unknown)"));
 
4513
                                 (!current_user.empty() ?  current_user : _("(unknown)")));
4522
4514
        break;
4523
4515
      case PROMPT_CHAR:
4524
4516
        {
4638
4630
{
4639
4631
  const char *ptr=strchr(line, ' ');
4640
4632
  if (ptr == NULL)
4641
 
    tee_fprintf(stdout, "Returning to default PROMPT of %s\n",
 
4633
    tee_fprintf(stdout, _("Returning to default PROMPT of %s\n"),
4642
4634
                default_prompt);
4643
4635
  prompt_counter = 0;
4644
4636
  char * tmpptr= strdup(ptr ? ptr+1 : default_prompt);
4645
4637
  if (tmpptr == NULL)
4646
 
    tee_fprintf(stdout, "Memory allocation error. Not changing prompt\n");
 
4638
    tee_fprintf(stdout, _("Memory allocation error. Not changing prompt\n"));
4647
4639
  else
4648
4640
  {
4649
4641
    current_prompt.erase();
4650
4642
    current_prompt= tmpptr;
4651
 
    tee_fprintf(stdout, "PROMPT set to '%s'\n", current_prompt.c_str());
 
4643
    tee_fprintf(stdout, _("PROMPT set to '%s'\n"), current_prompt.c_str());
4652
4644
  }
4653
4645
  return 0;
4654
4646
}