GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
version.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2013-2018 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if defined (HAVE_CONFIG_H)
24 # include "config.h"
25 #endif
26 
27 #include <string>
28 
29 #include "defaults.h"
30 #include "version.h"
31 
32 static std::string
33 octave_warranty_statement (const std::string& extra_info = "")
34 {
35  return "There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or\n\
36 FITNESS FOR A PARTICULAR PURPOSE."
37  + extra_info;
38 }
39 
40 static std::string
41 format_url (bool html, const std::string& url)
42 {
43  return html ? R"(<a href=")" + url + R"(">)" + url + "</a>" : url;
44 }
45 
48 {
49  return "Additional information about Octave is available at "
50  + format_url (html, "https://www.octave.org") + ".";
51 }
52 
55 {
56  return "Please contribute if you find this software useful.\n\
57 For more information, visit "
58  + format_url (html, "https://www.octave.org/get-involved.html");
59 }
60 
63 {
64  return "Read " + format_url (html, "https://www.octave.org/bugs.html")
65  + " to learn how to submit bug reports.";
66 }
67 
70 {
71  // The GNU coding standards say that on the first line printed by
72  // --version, the version number should follow the last space on the
73  // line.
74 
75  return "GNU Octave, version " OCTAVE_VERSION "\n" OCTAVE_COPYRIGHT;
76 }
77 
80  (bool html, const std::string& extra_info)
81 {
82  std::string br = (html ? "<br>\n" : "\n");
83  std::string sep = (html ? "\n</p>\n<p>\n" : "\n\n");
84 
86  + br
87  + "This is free software; see the source code for copying conditions."
88  + br
89  + octave_warranty_statement (extra_info)
90  + sep
91  + R"(Octave was configured for ")"
93  + R"(".)";
94 }
95 
98  (bool html, const std::string& extra_info)
99 {
100  std::string sep = (html ? "\n</p>\n<p>\n" : "\n\n");
101 
102  std::string msg;
103 
104  if (html)
105  msg = "<p>\n";
106 
108  + sep
109  + octave_www_statement (html)
110  + sep
111  + octave_contrib_statement (html)
112  + sep
113  + octave_bugs_statement (html)
114  + (html ? "\n</p>" : "");
115 
116  return msg;
117 }
118 
121 {
122  std::string msg
124  (html, " For details, type 'warranty'.");
125 
126  msg += (html ? "<p>\n" : "\n");
127 
128  msg += "For information about changes from previous versions, type 'news'.";
129 
130  msg += (html ? "\n</p>" : "");
131 
132  return msg;
133 }
std::string octave_startup_message(bool html)
Definition: version.cc:120
static std::string format_url(bool html, const std::string &url)
Definition: version.cc:41
#define OCTAVE_VERSION
Definition: main.in.cc:48
std::string octave_bugs_statement(bool html)
Definition: version.cc:62
#define OCTAVE_COPYRIGHT
Definition: version.in.h:49
std::string canonical_host_type(void)
Definition: defaults.cc:264
std::string octave_www_statement(bool html)
Definition: version.cc:47
std::string octave_contrib_statement(bool html)
Definition: version.cc:54
std::string url
Definition: urlwrite.cc:118
std::string octave_name_version_copyright_copying_warranty_and_bugs(bool html, const std::string &extra_info)
Definition: version.cc:98
static std::string octave_warranty_statement(const std::string &extra_info="")
Definition: version.cc:33
std::string octave_name_version_and_copyright(void)
Definition: version.cc:69
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:888
std::string octave_name_version_copyright_copying_and_warranty(bool html, const std::string &extra_info)
Definition: version.cc:80