2847
|
1 ## Copyright (C) 1996, 1997 John W. Eaton |
2313
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by |
7016
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
|
8 ## your option) any later version. |
2313
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
7016
|
16 ## along with Octave; see the file COPYING. If not, see |
|
17 ## <http://www.gnu.org/licenses/>. |
796
|
18 |
3449
|
19 ## -*- texinfo -*- |
|
20 ## @deftypefn {Function File} {} bug_report () |
2311
|
21 ## Have Octave create a bug report template file, invoke your favorite |
|
22 ## editor, and submit the report to the bug-octave mailing list when |
|
23 ## you are finished editing. |
3449
|
24 ## @end deftypefn |
796
|
25 |
2314
|
26 ## Author: jwe |
|
27 |
2311
|
28 function bug_report () |
796
|
29 |
|
30 if (nargin != 0) |
904
|
31 warning ("bug_report: ignoring extra arguments"); |
796
|
32 endif |
|
33 |
|
34 printf ("Please enter a one-line description of your bug report.\n\n"); |
|
35 fflush (stdout); |
|
36 |
|
37 subject = ""; |
|
38 subject = input ("Subject: ", "s"); |
|
39 |
2458
|
40 unwind_protect |
796
|
41 |
2458
|
42 prefs = tmpnam (); |
800
|
43 |
2458
|
44 if (! isempty (prefs)) |
5431
|
45 fid = fopen (prefs, "wt"); |
2993
|
46 if (fid > 0) |
|
47 dump_prefs (fid); |
|
48 fclose (fid); |
|
49 endif |
2458
|
50 endif |
796
|
51 |
4011
|
52 cmd = strcat ("octave-bug-", OCTAVE_VERSION); |
800
|
53 |
2458
|
54 if (length (subject) > 0) |
2832
|
55 cmd = sprintf ("%s -s \"%s\"", cmd, subject); |
2458
|
56 endif |
|
57 |
|
58 if (! isempty (prefs)) |
4469
|
59 cmd = sprintf ("%s \"%s\"", cmd, prefs); |
2458
|
60 endif |
800
|
61 |
2458
|
62 system (cmd); |
|
63 |
|
64 unwind_protect_cleanup |
800
|
65 |
2458
|
66 if (! isempty (prefs)) |
|
67 unlink (prefs); |
|
68 endif |
800
|
69 |
2458
|
70 end_unwind_protect |
802
|
71 |
796
|
72 endfunction |