1opam-var(1)                       Opam Manual                      opam-var(1)
2
3
4

NAME

6       opam-var - Prints the value associated with a given variable
7

SYNOPSIS

9       opam var [OPTION]... [VAR]
10

DESCRIPTION

12       With a VAR argument, prints the value associated with VAR. Without
13       argument, lists the opam variables currently defined. This command is a
14       shortcut to `opam config var` and `opam config list`.
15

OPTIONS

17       --package=PACKAGE
18           List all variables defined for the given package
19

COMMON OPTIONS

21       These options are common to all commands.
22
23       --best-effort
24           Don't fail if all requested packages can't be installed: try to
25           install as many as possible. Note that not all external solvers may
26           support this option (recent versions of aspcud or mccs should).
27
28       --color=WHEN
29           Colorize the output. WHEN must be one of `always', `never' or
30           `auto'.
31
32       --criteria=CRITERIA
33           Specify user preferences for dependency solving for this run.
34           Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
35           on the supported language, and the external solvers available, see
36           http://opam.ocaml.org/doc/Specifying_Solver_Preferences.html. A
37           general guide to using solver preferences can be found at
38           http://www.dicosmo.org/Articles/usercriteria.pdf.
39
40       --cudf=FILENAME
41           Debug option: Save the CUDF requests sent to the solver to
42           FILENAME-<n>.cudf.
43
44       --debug
45           Print debug message to stderr. This is equivalent to setting
46           $OPAMDEBUG to "true".
47
48       --debug-level=LEVEL
49           Like --debug, but allows specifying the debug level (--debug sets
50           it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
51
52       --git-version
53           Print the git version of opam, if set (i.e. you are using a
54           development version), and exit.
55
56       --help[=FMT] (default=auto)
57           Show this help in format FMT. The value FMT must be one of `auto',
58           `pager', `groff' or `plain'. With `auto', the format is `pager` or
59           `plain' whenever the TERM env var is `dumb' or undefined.
60
61       --ignore-pin-depends
62           Ignore extra pins required by packages that get pinned, either
63           manually through opam pin or through opam install DIR. This is
64           equivalent to setting IGNOREPINDEPENDS=true.
65
66       --json=FILENAME
67           Save the results of the opam run in a computer-readable file. If
68           the filename contains the character `%', it will be replaced by an
69           index that doesn't overwrite an existing file. Similar to setting
70           the $OPAMJSON variable.
71
72       --no-auto-upgrade
73           When configuring or updating a repository that is written for an
74           earlier opam version (1.2), opam internally converts it to the
75           current format. This disables this behaviour. Note that
76           repositories should define their format version in a 'repo' file at
77           their root, or they will be assumed to be in the older format. It
78           is, in any case, preferable to upgrade the repositories manually
79           using opam admin upgrade [--mirror URL] when possible.
80
81       --no-self-upgrade
82           Opam will replace itself with a newer binary found at OPAMROOT/opam
83           if present. This disables this behaviour.
84
85       -q, --quiet
86           Disables --verbose.
87
88       --root=ROOT
89           Use ROOT as the current root path. This is equivalent to setting
90           $OPAMROOT to ROOT.
91
92       --safe, --readonly
93           Make sure nothing will be automatically updated or rewritten.
94           Useful for calling from completion scripts, for example. Will fail
95           whenever such an operation is needed ; also avoids waiting for
96           locks, skips interactive questions and overrides the $OPAMDEBUG
97           variable.
98
99       --solver=CMD
100           Specify the CUDF solver to use for resolving package installation
101           problems. This is either a predefined solver (this version of opam
102           supports builtin-mccs+lp(), builtin-mccs+glpk, aspcud, mccs,
103           aspcud-old, packup), or a custom command that should contain the
104           variables %{input}%, %{output}%, %{criteria}%, and optionally
105           %{timeout}%.
106
107       --strict
108           Fail whenever an error is found in a package definition or a
109           configuration file. The default is to continue silently if
110           possible.
111
112       --switch=SWITCH
113           Use SWITCH as the current compiler switch. This is equivalent to
114           setting $OPAMSWITCH to SWITCH.
115
116       --use-internal-solver, --no-aspcud
117           Disable any external solver, and use the built-in one (this
118           requires that opam has been compiled with a built-in solver).
119
120       -v, --verbose
121           Be more verbose. One -v shows all package commands, repeat to also
122           display commands called internally (e.g. tar, curl, patch etc.)
123           Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
124
125       --version
126           Show version information.
127
128       -w, --working-dir
129           Whenever updating packages that are bound to a local,
130           version-controlled directory, update to the current working state
131           of their source instead of the last committed state, or the ref
132           they are pointing to. This only affects packages explicitly listed
133           on the command-line.
134
135       -y, --yes
136           Answer yes to all yes/no questions without prompting. This is
137           equivalent to setting $OPAMYES to "true".
138

ENVIRONMENT VARIABLES

140       Opam makes use of the environment variables listed here. Boolean
141       variables should be set to "0", "no", "false" or the empty string to
142       disable, "1", "yes" or "true" to enable.
143
144       OPAMCOLOR, when set to always or never, sets a default value for the
145       --color option.
146
147       OPAMCRITERIA specifies user preferences for dependency solving. The
148       default value depends on the solver version, use `config report` to
149       know the current setting. See also option --criteria
150
151       OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
152       for more options.
153
154       OPAMDEBUG see options `--debug' and `--debug-level'.
155
156       OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
157
158       OPAMERRLOGLEN sets the number of log lines printed when a sub-process
159       fails. 0 to print all.
160
161       OPAMEXTERNALSOLVER see option `--solver'.
162
163       OPAMFETCH specifies how to download files: either `wget', `curl' or a
164       custom command where variables %{url}%, %{out}%, %{retry}%,
165       %{compress}% and %{checksum}% will be replaced. Overrides the
166       'download-command' value from the main config file.
167
168       OPAMJOBS sets the maximum number of parallel workers to run.
169
170       OPAMJSON log json output to the given file (use character `%' to index
171       the files)
172
173       OPAMLOCK see option `--lock'.
174
175       OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
176       in an earlier format to the current one, on 'update' or 'init'.
177
178       OPAMKEEPLOGS tells opam to not remove some temporary command logs and
179       some backups. This skips some finalisers and may also help to get more
180       reliable backtraces
181
182       OPAMLOCKRETRIES sets the number of tries after which OPAM gives up
183       acquiring its lock and fails. <= 0 means infinite wait.
184
185       OPAMNO answer no to any question asked.
186
187       OPAMNOASPCUD see option `--no-aspcud'.
188
189       OPAMNOSELFUPGRADE see option `--no-self-upgrade'.
190
191       OPAMPINKINDAUTO sets whether version control systems should be detected
192       when pinning to a local path. Enabled by default since 1.3.0.
193
194       OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
195       available (e.g. for `opam install`).
196
197       OPAMRETRY sets the number of tries before failing downloads.
198
199       OPAMROOT see option `--root'. This is automatically set by `opam env
200       --root=DIR --set-root'.
201
202       OPAMROOTISOK don't complain when running as root.
203
204       OPAMSAFE see option `--safe'
205
206       OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
207       compatibility testing only.
208
209       OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
210       60.0, set to 0 for unlimited. Note that all solvers may not support
211       this option.
212
213       OPAMSTATUSLINE display a dynamic status line showing what's currently
214       going on on the terminal. (one of one of `always', `never' or `auto')
215
216       OPAMSWITCH see option `--switch'. Automatically set by `opam env
217       --switch=SWITCH --set-switch'.
218
219       OPAMUPGRADECRITERIA specifies user preferences for dependency solving
220       when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
221       are set. See also option --criteria
222
223       OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
224
225       OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
226       or `auto'). By default `auto', which is determined from the locale).
227
228       OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
229       Implies OPAMUTF8. This is set by default on OSX only.
230
231       OPAMVAR_var overrides the contents of the variable var when
232       substituting `%{var}%` strings in `opam` files.
233
234       OPAMVAR_package_var overrides the contents of the variable package:var
235       when substituting `%{package:var}%` strings in `opam` files.
236
237       OPAMVERBOSE see option `--verbose'.
238
239       OPAMYES see option `--yes'.
240

EXIT STATUS

242       As an exception to the following, the `exec' command returns 127 if the
243       command was not found or couldn't be executed, and the command's exit
244       value otherwise.
245
246       0   Success, or true for boolean queries.
247
248       1   False. Returned when a boolean return value is expected, e.g. when
249           running with --check, or for queries like opam lint.
250
251       2   Bad command-line arguments, or command-line arguments pointing to
252           an invalid context (e.g. file not following the expected format).
253
254       5   Not found. You requested something (package, version, repository,
255           etc.) that couldn't be found.
256
257       10  Aborted. The operation required confirmation, which wasn't given.
258
259       15  Could not acquire the locks required for the operation.
260
261       20  There is no solution to the user request. This can be caused by
262           asking to install two incompatible packages, for example.
263
264       30  Error in package definition, or other metadata files. Using
265           --strict raises this error more often.
266
267       31  Package script error. Some package operations were unsuccessful.
268           This may be an error in the packages or an incompatibility with
269           your system. This can be a partial error.
270
271       40  Sync error. Could not fetch some remotes from the network. This can
272           be a partial error.
273
274       50  Configuration error. Opam or system configuration doesn't allow
275           operation, and needs fixing.
276
277       60  Solver failure. The solver failed to return a sound answer. It can
278           be due to a broken external solver, or an error in solver
279           configuration.
280
281       99  Internal error. Something went wrong, likely due to a bug in opam
282           itself.
283
284       130 User interrupt. SIGINT was received, generally due to the user
285           pressing Ctrl-C.
286

FURTHER DOCUMENTATION

288       See https://opam.ocaml.org/doc.
289

AUTHORS

291       Vincent Bernardoff <vb@luminar.eu.org>
292       Raja Boujbel <raja.boujbel@ocamlpro.com>
293       Roberto Di Cosmo <roberto@dicosmo.org>
294       Thomas Gazagnaire <thomas@gazagnaire.org>
295       Louis Gesbert <louis.gesbert@ocamlpro.com>
296       Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
297       Anil Madhavapeddy <anil@recoil.org>
298       Guillem Rieu <guillem.rieu@ocamlpro.com>
299       Ralf Treinen <ralf.treinen@pps.jussieu.fr>
300       Frederic Tuong <tuong@users.gforge.inria.fr>
301

BUGS

303       Check bug reports at https://github.com/ocaml/opam/issues.
304
305
306
307Opam 2.0.1                                                         opam-var(1)
Impressum