@@ -410,22 +410,12 @@ module Options_implied_by_dash_p = struct
410
410
; promote_install_files
411
411
}
412
412
413
- let release_options =
414
- { root = Some " ."
415
- ; only_packages = No_restriction
416
- ; ignore_promoted_rules = true
417
- ; config_from_config_file = Dune_config.Partial. empty
418
- ; profile = Some Profile. Release
419
- ; default_target =
420
- Arg.Dep. alias_rec ~dir: Path.Local. root Dune_engine.Alias.Name. install
421
- ; always_show_command_line = true
422
- ; promote_install_files = true
423
- }
424
-
425
413
let dash_dash_release =
426
- let + (_ : bool ) =
427
414
Arg. (
428
- value & flag
415
+ value & alias [" --root" ;" ." ;" --ignore-promoted-rules" ;" --no-config" ;
416
+ " --profile" ;" release" ;" --always-show-command-line" ;
417
+ " --promote-install-files" ;
418
+ " --default-target" ;" @install" ]
429
419
& info [ " release" ] ~docs ~docv: " PACKAGES"
430
420
~doc:
431
421
" Put $(b,dune) into a reproducible $(i,release) mode. This is in \
@@ -435,11 +425,10 @@ module Options_implied_by_dash_p = struct
435
425
use this option for release builds. For instance, you must use \
436
426
this option in your $(i,<package>.opam) files. Except if you \
437
427
already use $(b,-p), as $(b,-p) implies this option." )
438
- in
439
- release_options
440
428
441
429
let options =
442
- let + t = one_of options dash_dash_release
430
+ let + t = options
431
+ and + _ = dash_dash_release
443
432
and + only_packages =
444
433
let + names =
445
434
Arg. (
@@ -463,11 +452,10 @@ module Options_implied_by_dash_p = struct
463
452
{ t with only_packages }
464
453
465
454
let dash_p =
466
- let + pkgs, args =
467
455
Term. with_used_args
468
456
Arg. (
469
457
value
470
- & opt (some packages) None
458
+ & alias_opt ( fun s -> [ " --release " ; " --only- packages" ;s] )
471
459
& info
472
460
[ " p" ; " for-release-of-packages" ]
473
461
~docs ~docv: " PACKAGES"
@@ -477,23 +465,17 @@ module Options_implied_by_dash_p = struct
477
465
order to build only what's necessary when your project \
478
466
contains multiple packages as well as getting reproducible \
479
467
builds." )
480
- in
481
- { release_options with
482
- only_packages =
483
- (match pkgs with
484
- | None -> No_restriction
485
- | Some names -> Restrict { names; command_line_option = List. hd args })
486
- }
487
468
488
469
let term =
489
- let + t = one_of options dash_p
470
+ let + t = options
471
+ and + _ = dash_p
490
472
and + profile =
491
473
let doc =
492
474
" Build profile. $(b,dev) if unspecified or $(b,release) if -p is set."
493
475
in
494
476
Arg. (
495
- value
496
- & opt (some profile) None
477
+ last
478
+ & opt_all (some profile) [ None ]
497
479
& info [ " profile" ] ~docs
498
480
~env: (Arg. env_var ~doc " DUNE_PROFILE" )
499
481
~doc:
0 commit comments