@@ -1302,9 +1302,15 @@ let option cli =
1302
1302
$ global_options cli $ fieldvalue $ global cli)
1303
1303
1304
1304
module Common_config_flags = struct
1305
- let sexp cli =
1306
- mk_flag ~cli cli_original [" sexp" ]
1307
- " Print environment as an s-expression rather than in shell format"
1305
+ let env_format cli =
1306
+ mk_vflag ~cli None [
1307
+ cli_original, Some `sexp , [" sexp" ],
1308
+ " Print environment as an s-expression rather than in shell format" ;
1309
+ cli_from cli2_4, Some `bindingss , [" bindingss" ],
1310
+ " Print environment as variable bindings rather than in shell format.\
1311
+ Useful to populate CI environment."
1312
+ ]
1313
+
1308
1314
1309
1315
let inplace_path cli =
1310
1316
mk_flag ~cli cli_original [" inplace-path" ]
@@ -1402,7 +1408,7 @@ let config cli =
1402
1408
let open Common_config_flags in
1403
1409
1404
1410
let config global_options
1405
- command shell sexp inplace_path
1411
+ command shell env_format inplace_path
1406
1412
set_opamroot set_opamswitch params () =
1407
1413
apply_global_options cli global_options;
1408
1414
let shell = match shell with
@@ -1418,7 +1424,7 @@ let config cli =
1418
1424
| Some sw ->
1419
1425
`Ok (OpamConfigCommand. env gt sw
1420
1426
~set_opamroot ~set_opamswitch
1421
- ~csh: (shell= SH_csh ) ~sexp ~fish: (shell= SH_fish )
1427
+ ~csh: (shell= SH_csh ) ~env_format ~fish: (shell= SH_fish )
1422
1428
~pwsh ~cmd: (shell= SH_cmd )
1423
1429
~inplace_path ))
1424
1430
| Some `revert_env , [] ->
@@ -1428,7 +1434,7 @@ let config cli =
1428
1434
| Some sw ->
1429
1435
`Ok (OpamConfigCommand. ensure_env gt sw;
1430
1436
OpamConfigCommand. print_eval_env
1431
- ~csh: (shell= SH_csh ) ~sexp ~fish: (shell= SH_fish )
1437
+ ~csh: (shell= SH_csh ) ~env_format ~fish: (shell= SH_fish )
1432
1438
~pwsh ~cmd: (shell= SH_cmd )
1433
1439
(OpamEnv. add [] [] )))
1434
1440
| Some `list , [] ->
@@ -1640,7 +1646,8 @@ let config cli =
1640
1646
1641
1647
mk_command_ret ~cli cli_original " config" ~doc ~man
1642
1648
Term. (const config
1643
- $ global_options cli $ command $ shell_opt cli cli_original $ sexp cli
1649
+ $ global_options cli $ command $ shell_opt cli cli_original
1650
+ $ env_format cli
1644
1651
$ inplace_path cli
1645
1652
$ set_opamroot cli $ set_opamswitch cli
1646
1653
$ params)
@@ -1711,7 +1718,7 @@ let env cli =
1711
1718
after printing the list of not up-to-date variables."
1712
1719
in
1713
1720
let env
1714
- global_options shell sexp inplace_path set_opamroot set_opamswitch
1721
+ global_options shell env_format inplace_path set_opamroot set_opamswitch
1715
1722
revert check () =
1716
1723
apply_global_options cli global_options;
1717
1724
if check then
@@ -1733,19 +1740,19 @@ let env cli =
1733
1740
| Some sw ->
1734
1741
OpamConfigCommand. env gt sw
1735
1742
~set_opamroot ~set_opamswitch
1736
- ~csh: (shell= SH_csh ) ~sexp ~fish: (shell= SH_fish )
1743
+ ~csh: (shell= SH_csh ) ~env_format ~fish: (shell= SH_fish )
1737
1744
~pwsh ~cmd: (shell= SH_cmd )
1738
1745
~inplace_path );
1739
1746
| true ->
1740
1747
OpamConfigCommand. print_eval_env
1741
- ~csh: (shell= SH_csh ) ~sexp ~fish: (shell= SH_fish )
1748
+ ~csh: (shell= SH_csh ) ~env_format ~fish: (shell= SH_fish )
1742
1749
~pwsh ~cmd: (shell= SH_cmd )
1743
1750
(OpamEnv. add [] [] )
1744
1751
in
1745
1752
let open Common_config_flags in
1746
1753
mk_command ~cli cli_original " env" ~doc ~man
1747
1754
Term. (const env
1748
- $ global_options cli $ shell_opt cli cli_original $ sexp cli
1755
+ $ global_options cli $ shell_opt cli cli_original $ env_format cli
1749
1756
$ inplace_path cli $ set_opamroot cli $ set_opamswitch cli
1750
1757
$ revert $ check)
1751
1758
0 commit comments