mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-08 04:20:07 +02:00
✨ Add phpmon-cli fix
command
This commit is contained in:
@ -11,6 +11,7 @@ import Foundation
|
|||||||
enum AllowedArguments: String, CaseIterable {
|
enum AllowedArguments: String, CaseIterable {
|
||||||
case use = "use"
|
case use = "use"
|
||||||
case performSwitch = "switch"
|
case performSwitch = "switch"
|
||||||
|
case fix = "fix"
|
||||||
case help = "help"
|
case help = "help"
|
||||||
|
|
||||||
static func has(_ string: String) -> Bool {
|
static func has(_ string: String) -> Bool {
|
||||||
|
@ -63,7 +63,11 @@ case .use, .performSwitch:
|
|||||||
Log.err("If this version is available, you may be able to install it by using `brew install php@\(version)`.")
|
Log.err("If this version is available, you may be able to install it by using `brew install php@\(version)`.")
|
||||||
exit(1)
|
exit(1)
|
||||||
}
|
}
|
||||||
|
case .fix:
|
||||||
|
Log.info("Fixing your PHP installation...")
|
||||||
|
Actions.fixMyPhp()
|
||||||
|
Log.info("All operations completed. You can check which version of PHP is linked by using `php -v`.")
|
||||||
|
exit(0)
|
||||||
case .help:
|
case .help:
|
||||||
print("""
|
print("""
|
||||||
===============================================================
|
===============================================================
|
||||||
@ -79,6 +83,8 @@ case .help:
|
|||||||
* use {version}: Switch to a specific version of PHP.
|
* use {version}: Switch to a specific version of PHP.
|
||||||
(e.g. `phpmon-cli use 8.0`)
|
(e.g. `phpmon-cli use 8.0`)
|
||||||
* switch {version}: Alias for the `use` command.
|
* switch {version}: Alias for the `use` command.
|
||||||
|
* fix Attempts to unlink all PHP versions,
|
||||||
|
and link the latest version of PHP.
|
||||||
* help: Show this help.
|
* help: Show this help.
|
||||||
|
|
||||||
SUPPORTED FLAGS
|
SUPPORTED FLAGS
|
||||||
|
Reference in New Issue
Block a user