1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
use clap::{Parser, Subcommand, ValueEnum};
use crate::project_info::{
Day, DependabotSchedule, LicenseType, ProjectManager, Pyo3PythonManager,
};
#[derive(Clone, Debug, ValueEnum)]
pub enum ApplicationOrLib {
Application,
Lib,
}
#[derive(Clone, Debug, ValueEnum)]
pub enum BooleanChoice {
True,
False,
}
#[derive(Debug, Parser)]
#[clap(author, version, about = "Generates a Python project")]
pub struct Args {
#[clap(subcommand)]
pub command: Command,
}
#[derive(Debug, Subcommand)]
pub enum Command {
/// Create a new project
Create {
#[clap(
short,
long,
help = "Use saved configuration and default values instead of prompting where possible"
)]
default: bool,
},
/// Save default config values
Config(Config),
}
#[derive(Debug, Parser)]
pub struct Config {
#[clap(subcommand)]
pub param: Param,
}
#[derive(Debug, Subcommand)]
pub enum Param {
/// Save a default creator
Creator { value: String },
/// Remove the saved config for creator
ResetCreator,
/// Save a default creator email address
CreatorEmail { value: String },
/// Remove the saved config for creator email
ResetCreatorEmail,
/// Save a default license
License { value: LicenseType },
/// Remove the saved license
ResetLicense,
/// Save a default Python version
PythonVersion { value: String },
/// Remove the saved Python version
ResetPythonVersion,
/// Save a default minimum Python version
MinPythonVersion { value: String },
/// Remove the saved minimum Python version
ResetMinPythonVersion,
/// Save a default project manager
ProjectManager { value: ProjectManager },
/// Remove the saved project manager
ResetProjectManager,
/// Save a default PyO3 python manager
Pyo3PythonManager { value: Pyo3PythonManager },
/// Remove the saved PyO3 Python manager
ResetPyo3PythonManager,
/// Save a default value for is async project
IsAsyncProject { value: BooleanChoice },
/// Remove the saved async project value
ResetIsAsyncProject,
/// Save a default value for Is Application
ApplicationOrLibrary { value: ApplicationOrLib },
/// Remove the saved application or library value
ResetApplicationOrLibrary,
/// Save default Python versions for GitHub Action testing
GithubActionPythonTestVersions { value: String },
/// Remove the saved github actions test versions
ResetGithubActionPythonTestVersions,
/// Save a default maximum line length
MaxLineLength { value: u8 },
/// Remove the saved max line length
ResetMaxLineLength,
/// Save a default value for Use Dependabot
UseDependabot { value: BooleanChoice },
/// Remove the saved use dependabot value
ResetUseDependabot,
/// Save a default value for Dependabot Schedule
DependabotSchedule { value: DependabotSchedule },
/// Remove the saved dependabot schedule
ResetDependabotSchedule,
/// Save a default value for Dependabot Day
DependabotDay { value: Day },
/// Remove the saved dependabot day
ResetDependabotDay,
/// Save a default value for Use Continuous Deployment
UseContinuousDeployment { value: BooleanChoice },
/// Remove the saved use continuous deployment value
ResetUseContinuousDeployment,
/// Save a default value for Use Release Drafter
UseReleaseDrafter { value: BooleanChoice },
/// Remove the saved use release drafter value
ResetUseReleaseDrafter,
/// Save a default value for Use Multi OS CI
UseMultiOsCi { value: BooleanChoice },
/// Remove the esaved use multi os ci value
ResetUseMultiOsCi,
/// Setup docs
IncludeDocs { value: BooleanChoice },
/// Remove the saved include docs value
ResetIncludeDocs,
#[cfg(feature = "fastapi")]
/// Save a default value for is FastAPI project
IsFastapiProject { value: BooleanChoice },
#[cfg(feature = "fastapi")]
/// Remove the is FastAPI project value
ResetIsFastapiProject,
/* #[cfg(feature = "fastapi")]
/// Save a default database value
Database { value: Database },
#[cfg(feature = "fastapi")]
/// Remove the database value
ResetDatabase,
#[cfg(feature = "fastapi")]
/// Save a default database manager
DatabaseManager { value: DatabaseManager },
#[cfg(feature = "fastapi")]
/// Remove the database manager value
ResetDatabaseManager, */
/// Rerset the config to the default values
Reset,
/// View the current config values
Show,
}