88
99import shtab
1010
11+ from pontos .enum import enum_choice , enum_type
1112from pontos .errors import PontosError
13+ from pontos .version .commands import ProjectType
1214from pontos .version .schemes import (
1315 VERSIONING_SCHEMES ,
1416 VersioningScheme ,
@@ -52,6 +54,13 @@ def initialize_default_parser() -> argparse.ArgumentParser:
5254 default = "pep440" ,
5355 type = versioning_scheme_argument_type ,
5456 )
57+ verify_parser .add_argument (
58+ "--project-types" ,
59+ help = "Project types to use for version information. Default is to consider all project types." ,
60+ nargs = "*" ,
61+ choices = enum_choice (ProjectType ),
62+ type = enum_type (ProjectType ),
63+ )
5564
5665 show_parser = subparsers .add_parser (
5766 "show" , help = "Show version information of the current project"
@@ -64,6 +73,13 @@ def initialize_default_parser() -> argparse.ArgumentParser:
6473 default = "pep440" ,
6574 type = versioning_scheme_argument_type ,
6675 )
76+ show_parser .add_argument (
77+ "--project-types" ,
78+ help = "Project types to use for version information. Default is to consider all project types." ,
79+ nargs = "*" ,
80+ choices = enum_choice (ProjectType ),
81+ type = enum_type (ProjectType ),
82+ )
6783
6884 update_parser = subparsers .add_parser (
6985 "update" , help = "Update version in the current project"
@@ -80,6 +96,13 @@ def initialize_default_parser() -> argparse.ArgumentParser:
8096 default = "pep440" ,
8197 type = versioning_scheme_argument_type ,
8298 )
99+ update_parser .add_argument (
100+ "--project-types" ,
101+ help = "Project types to use for version information. Default is to consider all project types." ,
102+ nargs = "*" ,
103+ choices = enum_choice (ProjectType ),
104+ type = enum_type (ProjectType ),
105+ )
83106 update_parser .add_argument (
84107 "--force" ,
85108 help = "Don't check if version is already set. "
@@ -112,6 +135,13 @@ def initialize_default_parser() -> argparse.ArgumentParser:
112135 default = "pep440" ,
113136 type = versioning_scheme_argument_type ,
114137 )
138+ next_parser .add_argument (
139+ "--project-types" ,
140+ help = "Project types to use for version information. Default is to consider all project types." ,
141+ nargs = "*" ,
142+ choices = enum_choice (ProjectType ),
143+ type = enum_type (ProjectType ),
144+ )
115145 return parser
116146
117147
0 commit comments