Mercurial > octave-nkf
comparison scripts/gethelp.cc @ 9014:71fca0fc2436
save source file names for functions as comments in .texi files
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 25 Mar 2009 12:54:17 -0400 |
parents | eb63fbe60fab |
children | a822560a3ce3 |
comparison
equal
deleted
inserted
replaced
9013:3b1908b58662 | 9014:71fca0fc2436 |
---|---|
133 | 133 |
134 int | 134 int |
135 main (int argc, char **argv) | 135 main (int argc, char **argv) |
136 { | 136 { |
137 std::string name; | 137 std::string name; |
138 std::string file_name; | |
138 | 139 |
139 if (argc != 2) | 140 if (argc != 3) |
140 { | 141 { |
141 std::cerr << "usage: gethelp name\n"; | 142 std::cerr << "usage: gethelp name file-name\n"; |
142 return 1; | 143 return 1; |
143 } | 144 } |
144 else | 145 else |
145 name = argv[1]; | 146 { |
147 name = argv[1]; | |
148 file_name = argv[2]; | |
149 } | |
146 | 150 |
147 std::string help_text = extract_help_text (); | 151 std::string help_text = extract_help_text (); |
148 | 152 |
149 if (! help_text.empty ()) | 153 if (! help_text.empty ()) |
150 { | 154 { |
151 std::cout << "" << name << "\n" << help_text; | 155 std::cout << "" << name << "\n" |
156 << "@c " << file_name << "\n" | |
157 << help_text; | |
152 | 158 |
153 if (help_text[help_text.length () - 1] != '\n') | 159 if (help_text[help_text.length () - 1] != '\n') |
154 std::cout << "\n"; | 160 std::cout << "\n"; |
155 } | 161 } |
156 | 162 |