Mercurial > hg > octave-nkf
comparison src/variables.cc @ 3248:68259f410026
[project @ 1999-07-13 03:34:54 by jwe]
author | jwe |
---|---|
date | Tue, 13 Jul 1999 03:40:17 +0000 |
parents | d54ef0aa6e82 |
children | 4d33b1e56bff |
comparison
equal
deleted
inserted
replaced
3247:256f98d26275 | 3248:68259f410026 |
---|---|
799 print_usage ("document"); | 799 print_usage ("document"); |
800 | 800 |
801 return retval; | 801 return retval; |
802 } | 802 } |
803 | 803 |
804 // XXX FIXME XXX -- this should take a list of regular expressions | |
805 // naming the variables to look for. | |
806 | |
807 static octave_value_list | 804 static octave_value_list |
808 do_who (int argc, const string_vector& argv) | 805 do_who (int argc, const string_vector& argv) |
809 { | 806 { |
810 octave_value_list retval; | 807 octave_value_list retval; |
811 | 808 |
812 bool show_builtins = false; | 809 bool show_builtins = false; |
813 bool show_functions = (curr_sym_tab == top_level_sym_tab); | 810 bool show_functions = false; |
814 bool show_variables = true; | 811 bool show_variables = false; |
815 bool show_verbose = false; | 812 bool show_verbose = false; |
816 | 813 |
817 string my_name = argv[0]; | 814 string my_name = argv[0]; |
818 | |
819 if (argc > 1) | |
820 { | |
821 show_functions = false; | |
822 show_variables = false; | |
823 } | |
824 | 815 |
825 int i; | 816 int i; |
826 for (i = 1; i < argc; i++) | 817 for (i = 1; i < argc; i++) |
827 { | 818 { |
828 if (argv[i] == "-all" || argv[i] == "-a") | 819 if (argv[i] == "-all" || argv[i] == "-a") |
844 argv[i].c_str ()); | 835 argv[i].c_str ()); |
845 else | 836 else |
846 break; | 837 break; |
847 } | 838 } |
848 | 839 |
840 // If no options were specified to select the type of symbol to | |
841 // display, then set defaults. | |
842 | |
843 if (! (show_builtins || show_functions || show_variables)) | |
844 { | |
845 show_functions = (curr_sym_tab == top_level_sym_tab); | |
846 show_variables = true; | |
847 } | |
848 | |
849 int npats = argc - i; | 849 int npats = argc - i; |
850 string_vector pats (npats); | 850 string_vector pats (npats); |
851 for (int j = 0; j < npats; j++) | 851 for (int j = 0; j < npats; j++) |
852 pats[j] = argv[i+j]; | 852 pats[j] = argv[i+j]; |
853 | 853 |