Permalink
Browse files

Trivial modifications of opam man pages: switch and install

  • Loading branch information...
1 parent 67680ab commit 64cc4d0409c8b33c74fe91d72a208c32c52fcfb3 Vincent Bernardoff committed Sep 12, 2012
Showing with 74 additions and 21 deletions.
  1. +18 −5 doc/man-src/opam-install.md
  2. +14 −6 doc/man-src/opam-switch.md
  3. +16 −2 doc/man/opam-install.1
  4. +26 −8 doc/man/opam-switch.1
@@ -8,15 +8,16 @@ opam-install - Install packages
# SYNOPSIS
-*opam install* \<package\>...
+*opam install* \<package\>[.\<version\>]...
# DESCRIPTION
This command installs one or more packages to the currently selected
compiler. To install packages for another compiler, you need to switch
compilers using *opam switch*. You can remove installed packages with
*opam remove*, and list installed packages with *opam list
--installed*.
+-installed*. See *opam pin* as well to understand how to manage
+package versions.
This command will make opam use the dependency solver to compute the
transitive closure of dependencies to be installed, and will handle
@@ -27,12 +28,24 @@ be performed.
# PARAMETERS
-\<package\>...
-: Package(s) to be installed.
+\<package\>[.\<version\>]...
+: Package(s) to be installed. An optional version can be specified,
+ instructing opam to install a particular version of the specified
+ package.
+
+# EXAMPLES
+
+* To install the last version of package "lwt", do:
+
+`$ opam install lwt`
+
+* To install "lwt" version 2.4.0, do:
+
+`$ opam install lwt.2.4.0`
# SEE ALSO
-**opam-remove**(1) **opam-switch**(1) **opam-list**(1)
+**opam-remove**(1) **opam-switch**(1) **opam-list**(1) **opam-pin**(1)
# OPAM
@@ -70,23 +70,31 @@ the EXAMPLES section to learn how to use this command.
* To install a brand new OCaml 4.00.0 and switch into it as the current
compiler, do:
-`$ opam switch -install 4.00.0`
+```
+$ opam switch -install 4.00.0
+```
* To remove OCaml 3.12.1, do:
-`$ opam switch -remove 3.12.1`
+```
+$ opam switch -remove 3.12.1
+```
* To install OCaml 4.00.0 under alias "foo" such that you will have
two instances of OCaml 4.00.0, each with its own environment
(i.e. list of installed packages, and so on):
-`$ opam switch -install foo -alias-of 4.00.0`
+```
+$ opam switch -install foo -alias-of 4.00.0
+```
* To install in "foo" all packages that are installed in "4.00.0":
-`$ opam switch foo
- $ opam switch -clone 4.00.0
-`
+```
+$ opam switch foo
+$ opam switch -clone 4.00.0
+```
+
# OPAM
Part of the opam(1) suite
@@ -4,7 +4,7 @@
opam-install - Install packages
.SH SYNOPSIS
.PP
-\f[I]opam install\f[] <package>...
+\f[I]opam install\f[] <package>[.<version>]...
.SH DESCRIPTION
.PP
This command installs one or more packages to the currently selected
@@ -13,6 +13,8 @@ To install packages for another compiler, you need to switch compilers
using \f[I]opam switch\f[].
You can remove installed packages with \f[I]opam remove\f[], and list
installed packages with \f[I]opam list -installed\f[].
+See \f[I]opam pin\f[] as well to understand how to manage package
+versions.
.PP
This command will make opam use the dependency solver to compute the
transitive closure of dependencies to be installed, and will handle
@@ -23,13 +25,25 @@ If dependencies are to be installed, opam will ask if the installation
should really be performed.
.SH PARAMETERS
.TP
-.B <package>...
+.B <package>[.<version>]...
Package(s) to be installed.
+An optional version can be specified, instructing opam to install a
+particular version of the specified package.
.RS
.RE
+.SH EXAMPLES
+.IP \[bu] 2
+To install the last version of package "lwt", do:
+.PP
+\f[C]$\ opam\ install\ lwt\f[]
+.IP \[bu] 2
+To install "lwt" version 2.4.0, do:
+.PP
+\f[C]$\ opam\ install\ lwt.2.4.0\f[]
.SH SEE ALSO
.PP
\f[B]opam-remove\f[](1) \f[B]opam-switch\f[](1) \f[B]opam-list\f[](1)
+\f[B]opam-pin\f[](1)
.SH OPAM
.PP
Part of the opam(1) suite
View
@@ -82,22 +82,40 @@ See EXAMPLES.
.IP \[bu] 2
To install a brand new OCaml 4.00.0 and switch into it as the current
compiler, do:
-.PP
-\f[C]$\ opam\ switch\ -install\ 4.00.0\f[]
+.IP
+.nf
+\f[C]
+$\ opam\ switch\ -install\ 4.00.0
+\f[]
+.fi
.IP \[bu] 2
To remove OCaml 3.12.1, do:
-.PP
-\f[C]$\ opam\ switch\ -remove\ 3.12.1\f[]
+.IP
+.nf
+\f[C]
+$\ opam\ switch\ -remove\ 3.12.1
+\f[]
+.fi
.IP \[bu] 2
To install OCaml 4.00.0 under alias "foo" such that you will have two
instances of OCaml 4.00.0, each with its own environment (i.e.
list of installed packages, and so on):
-.PP
-\f[C]$\ opam\ switch\ -install\ foo\ -alias-of\ 4.00.0\f[]
+.IP
+.nf
+\f[C]
+$\ opam\ switch\ -install\ foo\ -alias-of\ 4.00.0
+\f[]
+.fi
.IP \[bu] 2
To install in "foo" all packages that are installed in "4.00.0":
-.PP
-\f[C]$\ opam\ switch\ foo\ \ $\ opam\ switch\ -clone\ 4.00.0\f[] # OPAM
+.IP
+.nf
+\f[C]
+$\ opam\ switch\ foo
+$\ opam\ switch\ -clone\ 4.00.0
+\f[]
+.fi
+.SH OPAM
.PP
Part of the opam(1) suite
.SH AUTHORS

0 comments on commit 64cc4d0

Please sign in to comment.