[m-rev.] for review: do not include the fullarch in version and usage messages
Julien Fischer
jfischer at opturion.com
Thu Sep 7 10:01:29 AEST 2023
Do not include fullarch in version and usage messages.
The first line of usage and version messages have long been concluded with "on
<ARCH>" component, where <ARCH> is the value of FULLARCH baked into the
standard library. Omit this component, it doesn't convey any useful information
and we need to make some space on the first line for the optional package
version that will be added in an upcoming change.
compiler/handle_options.m:
profiler/mercury_profile.m:
slice/mcov.m:
As above.
Julien.
diff --git a/compiler/handle_options.m b/compiler/handle_options.m
index 7b48ea4..c9217b6 100644
--- a/compiler/handle_options.m
+++ b/compiler/handle_options.m
@@ -3116,9 +3116,9 @@ disable_smart_recompilation(ProgressStream, OptionDescr, !Globals, !IO) :-
%---------------------------------------------------------------------------%
display_compiler_version(ProgressStream, !IO) :-
- library.version(Version, FullArch),
- io.format(ProgressStream, "Mercury Compiler, version %s, on %s\n",
- [s(Version), s(FullArch)], !IO),
+ library.version(Version, _FullArch),
+ io.format(ProgressStream, "Mercury Compiler, version %s\n",
+ [s(Version)], !IO),
write_copyright_notice(ProgressStream, !IO).
usage_errors(ErrorStream, Globals, Specs, !IO) :-
@@ -3150,10 +3150,10 @@ long_usage(ProgressStream, !IO) :-
% long_usage is called from only one place, so can't print duplicate
% copies of the long usage message. We can print both a short and along
% usage message, but there is no simple way to avoid that.
- library.version(Version, Fullarch),
+ library.version(Version, _Fullarch),
io.format(ProgressStream,
- "Name: mmc - Melbourne Mercury Compiler, version %s, on %s\n",
- [s(Version), s(Fullarch)], !IO),
+ "Name: mmc - Melbourne Mercury Compiler, version %s\n",
+ [s(Version)], !IO),
write_copyright_notice(ProgressStream, !IO),
io.write_strings(ProgressStream, [
"Usage: mmc [<options>] <arguments>\n",
diff --git a/profiler/mercury_profile.m b/profiler/mercury_profile.m
index 2155d31..428acca 100644
--- a/profiler/mercury_profile.m
+++ b/profiler/mercury_profile.m
@@ -92,9 +92,9 @@ postprocess_options(Args, !IO) :-
:- pred display_version(io.text_output_stream::in, io::di, io::uo) is det.
display_version(OutputStream, !IO) :-
- library.version(Version, FullArch),
- io.format(OutputStream, "Mercury profiler, version %s, on %s\n",
- [s(Version), s(FullArch)], !IO),
+ library.version(Version, _FullArch),
+ io.format(OutputStream, "Mercury profiler, version %s\n",
+ [s(Version)], !IO),
write_copyright_notice(OutputStream, !IO).
% Display error message and then short usage message.
@@ -124,10 +124,10 @@ short_usage(OutputStream, !IO) :-
long_usage(OutputStream, !IO) :-
io.progname_base("mprof", ProgName, !IO),
- library.version(Version, FullArch),
+ library.version(Version, _FullArch),
io.format(OutputStream,
- "Name: mprof - Mercury profiler, version %s, on %s\n",
- [s(Version), s(FullArch)], !IO),
+ "Name: mprof - Mercury profiler, version %s\n",
+ [s(Version)], !IO),
write_copyright_notice(OutputStream, !IO),
io.write_strings(OutputStream, [
"Usage: ", ProgName, " [<options>] [<files>]\n",
diff --git a/slice/mcov.m b/slice/mcov.m
index 8a43823..97d18de 100644
--- a/slice/mcov.m
+++ b/slice/mcov.m
@@ -437,10 +437,10 @@ write_path_port_for_user(OutStream, port_and_path(Port, Path), !IO) :-
:- pred display_version(io.text_output_stream::in, io::di, io::uo) is det.
display_version(OutStream, !IO) :-
- library.version(Version, FullArch),
+ library.version(Version, _FullArch),
io.format(OutStream,
- "Mercury Coverage Testing Tool, version %s, on %s\n",
- [s(Version), s(FullArch)], !IO),
+ "Mercury Coverage Testing Tool, version %s\n",
+ [s(Version)], !IO),
write_copyright_notice(OutStream, !IO).
:- pred short_usage(io.text_output_stream::in, io::di, io::uo) is det.
@@ -456,10 +456,10 @@ short_usage(OutStream, !IO) :-
:- pred long_usage(io.text_output_stream::in, io::di, io::uo) is det.
long_usage(OutStream, !IO) :-
- library.version(Version, FullArch),
+ library.version(Version, _FullArch),
io.format(OutStream,
- "Name: mcov - Mercury Coverage Testing Tool, version %s, on %s\n",
- [s(Version), s(FullArch)], !IO),
+ "Name: mcov - Mercury Coverage Testing Tool, version %s\n",
+ [s(Version)], !IO),
write_copyright_notice(OutStream, !IO),
io.write_string(OutStream, "Usage: mcov [<options>] <arguments>\n", !IO),
io.write_string(OutStream, "Arguments:\n", !IO),
More information about the reviews
mailing list