mirror of
https://github.com/tw93/Mole.git
synced 2026-02-15 01:10:10 +00:00
Merge branch 'windows' into windows
This commit is contained in:
36
mole.ps1
36
mole.ps1
@@ -60,12 +60,12 @@ function Show-MainHelp {
|
||||
Write-Host ""
|
||||
Write-Host " ${green}COMMANDS:${nc}"
|
||||
Write-Host ""
|
||||
Write-Host " ${cyan}clean${nc} Deep system cleanup (caches, temp, logs)"
|
||||
Write-Host " ${cyan}clean${nc} Deep system cleanup"
|
||||
Write-Host " ${cyan}uninstall${nc} Smart application uninstaller"
|
||||
Write-Host " ${cyan}analyze${nc} Visual disk space analyzer"
|
||||
Write-Host " ${cyan}status${nc} Real-time system monitor"
|
||||
Write-Host " ${cyan}optimize${nc} System optimization and repairs"
|
||||
Write-Host " ${cyan}purge${nc} Clean project build artifacts"
|
||||
Write-Host " ${cyan}analyze${nc} Disk space analyzer"
|
||||
Write-Host " ${cyan}status${nc} System monitor"
|
||||
Write-Host " ${cyan}purge${nc} Clean project artifacts"
|
||||
Write-Host ""
|
||||
Write-Host " ${green}OPTIONS:${nc}"
|
||||
Write-Host ""
|
||||
@@ -83,6 +83,12 @@ function Show-MainHelp {
|
||||
Write-Host " ${gray}mo optimize${nc} ${gray}# Optimize system (includes repairs)${nc}"
|
||||
Write-Host " ${gray}mo optimize --dry-run${nc} ${gray}# Preview optimizations${nc}"
|
||||
Write-Host " ${gray}mo purge${nc} ${gray}# Clean dev artifacts${nc}"
|
||||
Write-Host " ${gray}mo${nc} ${gray}# Interactive menu${nc}"
|
||||
Write-Host " ${gray}mo clean${nc} ${gray}# Deep cleanup${nc}"
|
||||
Write-Host " ${gray}mo clean --dry-run${nc} ${gray}# Preview cleanup${nc}"
|
||||
Write-Host " ${gray}mo optimize${nc} ${gray}# Optimize system${nc}"
|
||||
Write-Host " ${gray}mo optimize --dry-run${nc} ${gray}# Preview optimization${nc}"
|
||||
Write-Host " ${gray}mo uninstall${nc} ${gray}# Uninstall apps${nc}"
|
||||
Write-Host ""
|
||||
Write-Host " ${green}ENVIRONMENT:${nc}"
|
||||
Write-Host ""
|
||||
@@ -105,6 +111,12 @@ function Show-MainMenu {
|
||||
Command = "clean"
|
||||
Icon = $script:Icons.Trash
|
||||
}
|
||||
@{
|
||||
Name = "Optimize"
|
||||
Description = "Optimization & repairs"
|
||||
Command = "optimize"
|
||||
Icon = $script:Icons.Arrow
|
||||
}
|
||||
@{
|
||||
Name = "Uninstall"
|
||||
Description = "Remove applications"
|
||||
@@ -123,12 +135,6 @@ function Show-MainMenu {
|
||||
Command = "status"
|
||||
Icon = $script:Icons.Solid
|
||||
}
|
||||
@{
|
||||
Name = "Optimize"
|
||||
Description = "Optimization & repairs"
|
||||
Command = "optimize"
|
||||
Icon = $script:Icons.Arrow
|
||||
}
|
||||
@{
|
||||
Name = "Purge"
|
||||
Description = "Clean dev artifacts"
|
||||
@@ -161,7 +167,7 @@ function Invoke-MoleCommand {
|
||||
if (-not (Test-Path $scriptPath)) {
|
||||
Write-MoleError "Unknown command: $CommandName"
|
||||
Write-Host ""
|
||||
Write-Host "Run 'mole -ShowHelp' for available commands"
|
||||
Write-Host "Run 'mo --help' for available commands"
|
||||
return
|
||||
}
|
||||
|
||||
@@ -177,13 +183,13 @@ function Invoke-MoleCommand {
|
||||
# Remove surrounding quotes if present
|
||||
$cleanArg = $arg.Trim("'`"")
|
||||
|
||||
if ($cleanArg -match '^-(\w+)$') {
|
||||
# It's a switch parameter (e.g., -DryRun)
|
||||
if ($cleanArg -match '^-{1,2}([\w-]+)$') {
|
||||
# It's a switch parameter (e.g., -DryRun or --dry-run)
|
||||
$paramName = $Matches[1]
|
||||
$splatParams[$paramName] = $true
|
||||
}
|
||||
elseif ($cleanArg -match '^-(\w+)[=:](.+)$') {
|
||||
# It's a named parameter with value (e.g., -Name=Value or -Name:Value)
|
||||
elseif ($cleanArg -match '^-{1,2}([\w-]+)[=:](.+)$') {
|
||||
# It's a named parameter with value (e.g., --name=value)
|
||||
$paramName = $Matches[1]
|
||||
$paramValue = $Matches[2].Trim("'`"")
|
||||
$splatParams[$paramName] = $paramValue
|
||||
|
||||
Reference in New Issue
Block a user