File tree Expand file tree Collapse file tree 3 files changed +40
-20
lines changed Expand file tree Collapse file tree 3 files changed +40
-20
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ SUBCOMMANDS:
40
40
Generates stub PHP files for the extension
41
41
42
42
$ cargo php install --help
43
- cargo-php-install
43
+ cargo-php-install
44
44
45
45
Installs the extension in the current PHP installation.
46
46
@@ -71,8 +71,11 @@ OPTIONS:
71
71
--release
72
72
Whether to install the release version of the extension
73
73
74
+ --yes
75
+ Bypasses the confirmation prompt
76
+
74
77
$ cargo php remove --help
75
- cargo-php-remove
78
+ cargo-php-remove
76
79
77
80
Removes the extension in the current PHP installation.
78
81
@@ -97,8 +100,11 @@ OPTIONS:
97
100
Path to the Cargo manifest of the extension. Defaults to the manifest in the directory
98
101
the command is called
99
102
103
+ --yes
104
+ Bypasses the confirmation prompt
105
+
100
106
$ cargo php stubs --help
101
- cargo-php-stubs
107
+ cargo-php-stubs
102
108
103
109
Generates stub PHP files for the extension.
104
110
@@ -120,7 +126,7 @@ OPTIONS:
120
126
--manifest <MANIFEST>
121
127
Path to the Cargo manifest of the extension. Defaults to the manifest in the directory
122
128
the command is called.
123
-
129
+
124
130
This cannot be provided alongside the `ext` option, as that option provides a direct
125
131
path to the extension shared library.
126
132
Original file line number Diff line number Diff line change @@ -105,6 +105,9 @@ struct Install {
105
105
/// the directory the command is called.
106
106
#[ arg( long) ]
107
107
manifest : Option < PathBuf > ,
108
+ /// Whether to bypass the install prompt.
109
+ #[ clap( long) ]
110
+ yes : bool ,
108
111
}
109
112
110
113
#[ derive( Parser ) ]
@@ -121,6 +124,9 @@ struct Remove {
121
124
/// the directory the command is called.
122
125
#[ arg( long) ]
123
126
manifest : Option < PathBuf > ,
127
+ /// Whether to bypass the remove prompt.
128
+ #[ clap( long) ]
129
+ yes : bool ,
124
130
}
125
131
126
132
#[ cfg( not( windows) ) ]
@@ -172,12 +178,13 @@ impl Install {
172
178
php_ini = Some ( ini_path) ;
173
179
}
174
180
175
- if !Confirm :: new ( )
176
- . with_prompt ( format ! (
177
- "Are you sure you want to install the extension `{}`?" ,
178
- artifact. name
179
- ) )
180
- . interact ( ) ?
181
+ if !self . yes
182
+ && !Confirm :: new ( )
183
+ . with_prompt ( format ! (
184
+ "Are you sure you want to install the extension `{}`?" ,
185
+ artifact. name
186
+ ) )
187
+ . interact ( ) ?
181
188
{
182
189
bail ! ( "Installation cancelled." ) ;
183
190
}
@@ -305,12 +312,13 @@ impl Remove {
305
312
bail ! ( "Unable to find extension installed." ) ;
306
313
}
307
314
308
- if !Confirm :: new ( )
309
- . with_prompt ( format ! (
310
- "Are you sure you want to remove the extension `{}`?" ,
311
- artifact. name
312
- ) )
313
- . interact ( ) ?
315
+ if !self . yes
316
+ && !Confirm :: new ( )
317
+ . with_prompt ( format ! (
318
+ "Are you sure you want to remove the extension `{}`?" ,
319
+ artifact. name
320
+ ) )
321
+ . interact ( ) ?
314
322
{
315
323
bail ! ( "Installation cancelled." ) ;
316
324
}
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ personally recommend for use in Visual Studio Code).
84
84
85
85
``` text
86
86
$ cargo php stubs --help
87
- cargo-php-stubs
87
+ cargo-php-stubs
88
88
89
89
Generates stub PHP files for the extension.
90
90
@@ -106,7 +106,7 @@ OPTIONS:
106
106
--manifest <MANIFEST>
107
107
Path to the Cargo manifest of the extension. Defaults to the manifest in the directory
108
108
the command is called.
109
-
109
+
110
110
This cannot be provided alongside the `ext` option, as that option provides a direct
111
111
path to the extension shared library.
112
112
@@ -130,7 +130,7 @@ so you are able to restore if you run into any issues.
130
130
131
131
``` text
132
132
$ cargo php install --help
133
- cargo-php-install
133
+ cargo-php-install
134
134
135
135
Installs the extension in the current PHP installation.
136
136
@@ -164,6 +164,9 @@ OPTIONS:
164
164
165
165
--release
166
166
Whether to install the release version of the extension
167
+
168
+ --yes
169
+ Bypasses the confirmation prompt
167
170
```
168
171
169
172
## Extension Removal
@@ -175,7 +178,7 @@ from your `php.ini` if present.
175
178
176
179
``` text
177
180
$ cargo php remove --help
178
- cargo-php-remove
181
+ cargo-php-remove
179
182
180
183
Removes the extension in the current PHP installation.
181
184
@@ -203,6 +206,9 @@ OPTIONS:
203
206
--manifest <MANIFEST>
204
207
Path to the Cargo manifest of the extension. Defaults to the manifest in the directory
205
208
the command is called
209
+
210
+ --yes
211
+ Bypasses the confirmation prompt
206
212
```
207
213
208
214
[ `cargo-php` ] : https://crates.io/crates/cargo-php
You can’t perform that action at this time.
0 commit comments