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