comparison src/variables.cc @ 1857:99d5b59cb855

[project @ 1996-02-04 08:02:58 by jwe]
author jwe
date Sun, 04 Feb 1996 08:02:58 +0000
parents effa9400766f
children e62277bf5fe0
comparison
equal deleted inserted replaced
1856:1e1e1c0b8c1b 1857:99d5b59cb855
1224 { 1224 {
1225 show_functions = 0; 1225 show_functions = 0;
1226 show_variables = 0; 1226 show_variables = 0;
1227 } 1227 }
1228 1228
1229 for (int i = 1; i < argc; i++) 1229 int i;
1230 for (i = 1; i < argc; i++)
1230 { 1231 {
1231 if (argv[i] == "-all" || argv[i] == "-a") 1232 if (argv[i] == "-all" || argv[i] == "-a")
1232 { 1233 {
1233 show_builtins++; 1234 show_builtins++;
1234 show_functions++; 1235 show_functions++;
1247 argv[i].c_str ()); 1248 argv[i].c_str ());
1248 else 1249 else
1249 break; 1250 break;
1250 } 1251 }
1251 1252
1253 int npats = argc - i;
1254 string_vector pats (npats);
1255 for (int j = 0; j < npats; j++)
1256 pats[j] = argv[i+j];
1257
1252 // If the user specified -l and nothing else, show variables. If 1258 // If the user specified -l and nothing else, show variables. If
1253 // evaluating this at the top level, also show functions. 1259 // evaluating this at the top level, also show functions.
1254 1260
1255 if (show_verbose && ! (show_builtins || show_functions || show_variables)) 1261 if (show_verbose && ! (show_builtins || show_functions || show_variables))
1256 { 1262 {
1261 ostrstream output_buf; 1267 ostrstream output_buf;
1262 int pad_after = 0; 1268 int pad_after = 0;
1263 1269
1264 if (show_builtins) 1270 if (show_builtins)
1265 { 1271 {
1266 pad_after += maybe_list ("*** built-in variables:", argv, argc, 1272 pad_after += maybe_list ("*** built-in variables:", pats, npats,
1267 output_buf, show_verbose, global_sym_tab, 1273 output_buf, show_verbose, global_sym_tab,
1268 symbol_def::BUILTIN_VARIABLE, 1274 symbol_def::BUILTIN_VARIABLE,
1269 SYMTAB_ALL_SCOPES); 1275 SYMTAB_ALL_SCOPES);
1270 1276
1271 pad_after += maybe_list ("*** built-in functions:", argv, argc, 1277 pad_after += maybe_list ("*** built-in functions:", pats, npats,
1272 output_buf, show_verbose, global_sym_tab, 1278 output_buf, show_verbose, global_sym_tab,
1273 symbol_def::BUILTIN_FUNCTION, 1279 symbol_def::BUILTIN_FUNCTION,
1274 SYMTAB_ALL_SCOPES); 1280 SYMTAB_ALL_SCOPES);
1275 } 1281 }
1276 1282
1277 if (show_functions) 1283 if (show_functions)
1278 { 1284 {
1279 pad_after += maybe_list ("*** currently compiled functions:", 1285 pad_after += maybe_list ("*** currently compiled functions:",
1280 argv, argc, output_buf, show_verbose, 1286 pats, npats, output_buf, show_verbose,
1281 global_sym_tab, symbol_def::USER_FUNCTION, 1287 global_sym_tab, symbol_def::USER_FUNCTION,
1282 SYMTAB_ALL_SCOPES); 1288 SYMTAB_ALL_SCOPES);
1283 } 1289 }
1284 1290
1285 if (show_variables) 1291 if (show_variables)
1286 { 1292 {
1287 pad_after += maybe_list ("*** local user variables:", argv, argc, 1293 pad_after += maybe_list ("*** local user variables:", pats, npats,
1288 output_buf, show_verbose, curr_sym_tab, 1294 output_buf, show_verbose, curr_sym_tab,
1289 symbol_def::USER_VARIABLE, 1295 symbol_def::USER_VARIABLE,
1290 SYMTAB_LOCAL_SCOPE); 1296 SYMTAB_LOCAL_SCOPE);
1291 1297
1292 pad_after += maybe_list ("*** globally visible user variables:", 1298 pad_after += maybe_list ("*** globally visible user variables:",
1293 argv, argc, output_buf, show_verbose, 1299 pats, npats, output_buf, show_verbose,
1294 curr_sym_tab, symbol_def::USER_VARIABLE, 1300 curr_sym_tab, symbol_def::USER_VARIABLE,
1295 SYMTAB_GLOBAL_SCOPE); 1301 SYMTAB_GLOBAL_SCOPE);
1296 } 1302 }
1297 1303
1298 if (pad_after) 1304 if (pad_after)