7017
|
1 ## Copyright (C) 2005, 2006, 2007 William Poetra Yoga Hadisoeseno |
5546
|
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. |
5546
|
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/>. |
5546
|
18 |
|
19 ## -*- texinfo -*- |
6615
|
20 ## @deftypefn {Function File} {} ver () |
|
21 ## Display a header containing the current Octave version |
|
22 ## number, license string and operating system. |
5642
|
23 ## @seealso{license, version} |
5546
|
24 ## @end deftypefn |
|
25 |
|
26 ## Author: William Poetra Yoga Hadisoeseno <williampoetra@gmail.com> |
|
27 |
|
28 function ver () |
|
29 |
|
30 if (nargin > 0) |
6046
|
31 print_usage (); |
5546
|
32 endif |
|
33 |
5548
|
34 octave_license = license (); |
|
35 |
|
36 [unm, status] = uname (); |
5546
|
37 |
5548
|
38 if (status < 0) |
|
39 os_string = "unknown"; |
5546
|
40 else |
5548
|
41 os_string = sprintf ("%s %s %s %s", unm.sysname, unm.release, |
|
42 unm.version, unm.machine); |
5546
|
43 endif |
|
44 |
|
45 hbar(1:70) = "-"; |
|
46 ver_line1 = "GNU Octave Version "; |
5548
|
47 ver_line2 = "GNU Octave License: "; |
5546
|
48 ver_line3 = "Operating System: "; |
|
49 |
|
50 ver_desc = sprintf ("%s\n%s%s\n%s%s\n%s%s\n%s\n", hbar, ver_line1, version, |
|
51 ver_line2, octave_license, ver_line3, os_string, hbar); |
|
52 |
5548
|
53 puts (ver_desc); |
5546
|
54 |
|
55 endfunction |