@@ -457,10 +457,16 @@ def run(self):
457
457
return 0
458
458
459
459
460
+ def _raise_error_if_all_disabled (** kwargs ):
461
+ if not any (kwargs .values ()):
462
+ raise InvalidArgumentError (
463
+ "Either of `-w|--workspace`, `-a|--all-branches`, `-T|--all-tags` "
464
+ "or `--all-commits` needs to be set."
465
+ )
466
+
467
+
460
468
class CmdExperimentsGC (CmdRepro ):
461
469
def run (self ):
462
- from dvc .repo .gc import _raise_error_if_all_disabled
463
-
464
470
_raise_error_if_all_disabled (
465
471
all_branches = self .args .all_branches ,
466
472
all_tags = self .args .all_tags ,
@@ -600,7 +606,7 @@ def add_parser(subparsers, parent_parser):
600
606
"experiments" ,
601
607
parents = [parent_parser ],
602
608
aliases = ["exp" ],
603
- description = append_doc_link (EXPERIMENTS_HELP , "experiments " ),
609
+ description = append_doc_link (EXPERIMENTS_HELP , "exp " ),
604
610
formatter_class = argparse .RawDescriptionHelpFormatter ,
605
611
help = EXPERIMENTS_HELP ,
606
612
)
@@ -617,7 +623,7 @@ def add_parser(subparsers, parent_parser):
617
623
experiments_show_parser = experiments_subparsers .add_parser (
618
624
"show" ,
619
625
parents = [parent_parser ],
620
- description = append_doc_link (EXPERIMENTS_SHOW_HELP , "experiments /show" ),
626
+ description = append_doc_link (EXPERIMENTS_SHOW_HELP , "exp /show" ),
621
627
help = EXPERIMENTS_SHOW_HELP ,
622
628
formatter_class = argparse .RawDescriptionHelpFormatter ,
623
629
)
@@ -626,20 +632,20 @@ def add_parser(subparsers, parent_parser):
626
632
"--all-branches" ,
627
633
action = "store_true" ,
628
634
default = False ,
629
- help = "Show metrics for all branches." ,
635
+ help = "Show experiments derived from the tip of all Git branches." ,
630
636
)
631
637
experiments_show_parser .add_argument (
632
638
"-T" ,
633
639
"--all-tags" ,
634
640
action = "store_true" ,
635
641
default = False ,
636
- help = "Show metrics for all tags." ,
642
+ help = "Show experiments derived from all Git tags." ,
637
643
)
638
644
experiments_show_parser .add_argument (
639
645
"--all-commits" ,
640
646
action = "store_true" ,
641
647
default = False ,
642
- help = "Show metrics for all commits." ,
648
+ help = "Show experiments derived from all Git commits." ,
643
649
)
644
650
experiments_show_parser .add_argument (
645
651
"--no-pager" ,
@@ -721,9 +727,7 @@ def add_parser(subparsers, parent_parser):
721
727
experiments_apply_parser = experiments_subparsers .add_parser (
722
728
"apply" ,
723
729
parents = [parent_parser ],
724
- description = append_doc_link (
725
- EXPERIMENTS_APPLY_HELP , "experiments/apply"
726
- ),
730
+ description = append_doc_link (EXPERIMENTS_APPLY_HELP , "exp/apply" ),
727
731
help = EXPERIMENTS_APPLY_HELP ,
728
732
formatter_class = argparse .RawDescriptionHelpFormatter ,
729
733
)
@@ -744,7 +748,7 @@ def add_parser(subparsers, parent_parser):
744
748
experiments_diff_parser = experiments_subparsers .add_parser (
745
749
"diff" ,
746
750
parents = [parent_parser ],
747
- description = append_doc_link (EXPERIMENTS_DIFF_HELP , "experiments /diff" ),
751
+ description = append_doc_link (EXPERIMENTS_DIFF_HELP , "exp /diff" ),
748
752
help = EXPERIMENTS_DIFF_HELP ,
749
753
formatter_class = argparse .RawDescriptionHelpFormatter ,
750
754
)
@@ -803,7 +807,7 @@ def add_parser(subparsers, parent_parser):
803
807
experiments_run_parser = experiments_subparsers .add_parser (
804
808
"run" ,
805
809
parents = [parent_parser ],
806
- description = append_doc_link (EXPERIMENTS_RUN_HELP , "experiments /run" ),
810
+ description = append_doc_link (EXPERIMENTS_RUN_HELP , "exp /run" ),
807
811
help = EXPERIMENTS_RUN_HELP ,
808
812
formatter_class = argparse .RawDescriptionHelpFormatter ,
809
813
)
@@ -818,9 +822,7 @@ def add_parser(subparsers, parent_parser):
818
822
"resume" ,
819
823
parents = [parent_parser ],
820
824
aliases = ["res" ],
821
- description = append_doc_link (
822
- EXPERIMENTS_RESUME_HELP , "experiments/resume"
823
- ),
825
+ description = append_doc_link (EXPERIMENTS_RESUME_HELP , "exp/resume" ),
824
826
help = EXPERIMENTS_RESUME_HELP ,
825
827
formatter_class = argparse .RawDescriptionHelpFormatter ,
826
828
)
@@ -848,9 +850,7 @@ def add_parser(subparsers, parent_parser):
848
850
experiments_gc_parser = experiments_subparsers .add_parser (
849
851
"gc" ,
850
852
parents = [parent_parser ],
851
- description = append_doc_link (
852
- EXPERIMENTS_GC_DESCRIPTION , "experiments/gc"
853
- ),
853
+ description = append_doc_link (EXPERIMENTS_GC_DESCRIPTION , "exp/gc" ),
854
854
help = EXPERIMENTS_GC_HELP ,
855
855
formatter_class = argparse .RawDescriptionHelpFormatter ,
856
856
)
@@ -903,9 +903,7 @@ def add_parser(subparsers, parent_parser):
903
903
experiments_branch_parser = experiments_subparsers .add_parser (
904
904
"branch" ,
905
905
parents = [parent_parser ],
906
- description = append_doc_link (
907
- EXPERIMENTS_BRANCH_HELP , "experiments/branch"
908
- ),
906
+ description = append_doc_link (EXPERIMENTS_BRANCH_HELP , "exp/branch" ),
909
907
help = EXPERIMENTS_BRANCH_HELP ,
910
908
formatter_class = argparse .RawDescriptionHelpFormatter ,
911
909
)
@@ -921,7 +919,7 @@ def add_parser(subparsers, parent_parser):
921
919
experiments_list_parser = experiments_subparsers .add_parser (
922
920
"list" ,
923
921
parents = [parent_parser ],
924
- description = append_doc_link (EXPERIMENTS_LIST_HELP , "experiments /list" ),
922
+ description = append_doc_link (EXPERIMENTS_LIST_HELP , "exp /list" ),
925
923
help = EXPERIMENTS_LIST_HELP ,
926
924
formatter_class = argparse .RawDescriptionHelpFormatter ,
927
925
)
@@ -955,7 +953,7 @@ def add_parser(subparsers, parent_parser):
955
953
experiments_push_parser = experiments_subparsers .add_parser (
956
954
"push" ,
957
955
parents = [parent_parser ],
958
- description = append_doc_link (EXPERIMENTS_PUSH_HELP , "experiments /push" ),
956
+ description = append_doc_link (EXPERIMENTS_PUSH_HELP , "exp /push" ),
959
957
help = EXPERIMENTS_PUSH_HELP ,
960
958
formatter_class = argparse .RawDescriptionHelpFormatter ,
961
959
)
@@ -1011,7 +1009,7 @@ def add_parser(subparsers, parent_parser):
1011
1009
experiments_pull_parser = experiments_subparsers .add_parser (
1012
1010
"pull" ,
1013
1011
parents = [parent_parser ],
1014
- description = append_doc_link (EXPERIMENTS_PULL_HELP , "experiments /pull" ),
1012
+ description = append_doc_link (EXPERIMENTS_PULL_HELP , "exp /pull" ),
1015
1013
help = EXPERIMENTS_PULL_HELP ,
1016
1014
formatter_class = argparse .RawDescriptionHelpFormatter ,
1017
1015
)
@@ -1076,6 +1074,7 @@ def _add_run_common(parser):
1076
1074
"Human-readable experiment name. If not specified, a name will "
1077
1075
"be auto-generated."
1078
1076
),
1077
+ metavar = "<name>" ,
1079
1078
)
1080
1079
parser .add_argument (
1081
1080
"--params" ,
0 commit comments