Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Normalize the version string for all installed executables

  • Loading branch information...
commit 4ac99d5a8d736de429b801add7833bc069b0fcb4 1 parent 2d77f20
@samoht samoht authored
View
16 src/globals.ml.in
@@ -70,8 +70,6 @@ let error_and_exit fmt =
raise (Exit 66)
) fmt
-let exit i = raise (Exit i)
-
let msg fmt =
Printf.ksprintf (fun str ->
Printf.printf "%s%!" str
@@ -113,3 +111,17 @@ let os_string = match os with
let makecmd = ref (match os with FreeBSD | OpenBSD -> "gmake" | _ -> "make") (* WARNING check the result of "which gmake", "which make", ... *)
let default_cores = 1
+
+let version () =
+ Printf.printf "\
+%s version %s
+
+Copyright (C) 2012 OCamlPro - INRIA
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
+ Sys.argv.(0) version;
+ exit 0
+
+let exit i =
+ raise (Exit i)
View
21 src/opam.ml
@@ -20,17 +20,6 @@ open Solver
open Client
open SubCommand
-let version () =
- Printf.printf "\
-%s version %s
-
-Copyright (C) 2012 OCamlPro - INRIA
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
- Sys.argv.(0) Globals.version;
- exit 0
-
let ano_args = ref []
let anon s =
ano_args := s :: !ano_args
@@ -49,11 +38,11 @@ let () = Globals.root_path := Globals.default_opam_path
let quiet = ref false
let global_args = [
- "--debug" , Arg.Set Globals.debug, " Print more debug messages";
- "--verbose" , Arg.Set Globals.verbose, " Display the stdout/stderr of subprocesses";
- "--quiet" , Arg.Clear quiet, " Not display the stdout/stderr of subprocesses";
- "--version" , Arg.Unit version, " Display version information";
- "--yes" , Arg.Set Globals.yes, " Answer yes to all questions";
+ "--debug" , Arg.Set Globals.debug , " Print internal debug messages (very verbose)";
+ "--verbose" , Arg.Set Globals.verbose , " Display the output of subprocesses";
+ "--quiet" , Arg.Clear quiet , " Do not display the output of subprocesses";
+ "--version" , Arg.Unit Globals.version, " Display version information";
+ "--yes" , Arg.Set Globals.yes , " Answer yes to all questions";
"--makecmd" , Arg.Set_string Globals.makecmd,
Printf.sprintf " Set the 'make' program used when compiling packages (default is %s)" !Globals.makecmd;
"--root" , Arg.Set_string Globals.root_path,
View
5 src/scripts/opam_check.ml
@@ -6,8 +6,9 @@ let usage = "opam-check [--root root] [-l label] <package>+"
let label = ref ""
let spec = Arg.align [
- ("--root", Arg.Set_string Globals.root_path, " set opam path");
- ("-l" , Arg.Set_string label , " set a test label");
+ ("--root", Arg.Set_string Globals.root_path, " Set opam path");
+ ("-l" , Arg.Set_string label , " Set a test label");
+ ("--version", Arg.Unit Globals.version , " Display version information");
]
let packages = ref []
View
8 src/scripts/opam_mk_repo.ml
@@ -26,10 +26,6 @@ open Types
let log fmt = Globals.log "OPAM-MK-REPO" fmt
-let version () =
- Printf.printf "%s: version %s\n" Sys.argv.(0) Globals.version;
- exit 1
-
let all, index, packages, gener_digest, dryrun =
let usage = Printf.sprintf "%s [-all] [<package>]*" (Stdlib_filename.basename Sys.argv.(0)) in
let all = ref true in
@@ -38,8 +34,8 @@ let all, index, packages, gener_digest, dryrun =
let gener_digest = ref false in
let dryrun = ref false in
let specs = Arg.align [
- ("-v" , Arg.Unit version, " Display version information");
- ("--version", Arg.Unit version, " Display version information");
+ ("-v" , Arg.Unit Globals.version, " Display version information");
+ ("--version", Arg.Unit Globals.version, " Display version information");
("-a" , Arg.Set all, "");
("--all", Arg.Set all , Printf.sprintf " Build all package archives (default is %b)" !all);
View
8 src/scripts/opam_repo_check.ml
@@ -5,14 +5,16 @@ open File
let () =
let usage = Printf.sprintf "Usage: %s" Sys.argv.(0) in
- let specs = [] in
+ let specs = [
+ ("--version", Arg.Unit Globals.version, " Display version information")
+ ] in
let ano x =
Printf.eprintf "%s: invalid argument" x in
Arg.parse specs ano usage
-let () =
+let () =
let t = Path.R.of_dirname (Dirname.cwd ()) in
- NV.Set.iter (fun nv ->
+ NV.Set.iter (fun nv ->
Globals.msg "Processing %s\n" (NV.to_string nv);
(** Descr *)
Please sign in to comment.
Something went wrong with that request. Please try again.