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:
4040 Generates stub PHP files for the extension
4141
4242$ cargo php install --help
43- cargo-php-install
43+ cargo-php-install
4444
4545Installs the extension in the current PHP installation.
4646
@@ -71,8 +71,11 @@ OPTIONS:
7171 --release
7272 Whether to install the release version of the extension
7373
74+ --yes
75+ Bypasses the confirmation prompt
76+
7477$ cargo php remove --help
75- cargo-php-remove
78+ cargo-php-remove
7679
7780Removes the extension in the current PHP installation.
7881
@@ -97,8 +100,11 @@ OPTIONS:
97100 Path to the Cargo manifest of the extension. Defaults to the manifest in the directory
98101 the command is called
99102
103+ --yes
104+ Bypasses the confirmation prompt
105+
100106$ cargo php stubs --help
101- cargo-php-stubs
107+ cargo-php-stubs
102108
103109Generates stub PHP files for the extension.
104110
@@ -120,7 +126,7 @@ OPTIONS:
120126 --manifest <MANIFEST>
121127 Path to the Cargo manifest of the extension. Defaults to the manifest in the directory
122128 the command is called.
123-
129+
124130 This cannot be provided alongside the `ext` option, as that option provides a direct
125131 path to the extension shared library.
126132
Original file line number Diff line number Diff line change @@ -105,6 +105,9 @@ struct Install {
105105 /// the directory the command is called.
106106 #[ arg( long) ]
107107 manifest : Option < PathBuf > ,
108+ /// Whether to bypass the install prompt.
109+ #[ clap( long) ]
110+ yes : bool ,
108111}
109112
110113#[ derive( Parser ) ]
@@ -121,6 +124,9 @@ struct Remove {
121124 /// the directory the command is called.
122125 #[ arg( long) ]
123126 manifest : Option < PathBuf > ,
127+ /// Whether to bypass the remove prompt.
128+ #[ clap( long) ]
129+ yes : bool ,
124130}
125131
126132#[ cfg( not( windows) ) ]
@@ -172,12 +178,13 @@ impl Install {
172178 php_ini = Some ( ini_path) ;
173179 }
174180
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 ( ) ?
181188 {
182189 bail ! ( "Installation cancelled." ) ;
183190 }
@@ -305,12 +312,13 @@ impl Remove {
305312 bail ! ( "Unable to find extension installed." ) ;
306313 }
307314
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 ( ) ?
314322 {
315323 bail ! ( "Installation cancelled." ) ;
316324 }
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ personally recommend for use in Visual Studio Code).
8484
8585``` text
8686$ cargo php stubs --help
87- cargo-php-stubs
87+ cargo-php-stubs
8888
8989Generates stub PHP files for the extension.
9090
@@ -106,7 +106,7 @@ OPTIONS:
106106 --manifest <MANIFEST>
107107 Path to the Cargo manifest of the extension. Defaults to the manifest in the directory
108108 the command is called.
109-
109+
110110 This cannot be provided alongside the `ext` option, as that option provides a direct
111111 path to the extension shared library.
112112
@@ -130,7 +130,7 @@ so you are able to restore if you run into any issues.
130130
131131``` text
132132$ cargo php install --help
133- cargo-php-install
133+ cargo-php-install
134134
135135Installs the extension in the current PHP installation.
136136
@@ -164,6 +164,9 @@ OPTIONS:
164164
165165 --release
166166 Whether to install the release version of the extension
167+
168+ --yes
169+ Bypasses the confirmation prompt
167170```
168171
169172## Extension Removal
@@ -175,7 +178,7 @@ from your `php.ini` if present.
175178
176179``` text
177180$ cargo php remove --help
178- cargo-php-remove
181+ cargo-php-remove
179182
180183Removes the extension in the current PHP installation.
181184
@@ -203,6 +206,9 @@ OPTIONS:
203206 --manifest <MANIFEST>
204207 Path to the Cargo manifest of the extension. Defaults to the manifest in the directory
205208 the command is called
209+
210+ --yes
211+ Bypasses the confirmation prompt
206212```
207213
208214[ `cargo-php` ] : https://crates.io/crates/cargo-php
You can’t perform that action at this time.
0 commit comments