1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 14:26:46 +00:00

refactor: standardize CLI with 'mo' alias and lowercase flags

Addresses tw93's PR #305 feedback:
- Add 'mo' short alias (mo.cmd) alongside mole.cmd
- Use 'mo' in all help text and documentation
- Document lowercase flag style (--dry-run, --help, etc.)
- Simplify optimize: repairs run automatically, no extra flags
- Fix RepairsApplied counter bug in optimize.ps1
- Update README with standardized examples
This commit is contained in:
Bhadra
2026-01-16 12:45:07 +05:30
parent 381a5f064c
commit 8e661a7b22
9 changed files with 148 additions and 162 deletions

View File

@@ -61,40 +61,40 @@ cd Mole
Run:
```powershell
mole # Interactive menu
mole clean # Deep cleanup
mole uninstall # Remove apps + leftovers
mole optimize # Refresh caches & services
mole analyze # Visual disk explorer
mole status # Live system health dashboard
mole purge # Clean project build artifacts
mo # Interactive menu
mo clean # Deep cleanup
mo uninstall # Remove apps + leftovers
mo optimize # Refresh caches & services
mo analyze # Visual disk explorer
mo status # Live system health dashboard
mo purge # Clean project build artifacts
mole -ShowHelp # Show help
mole -Version # Show installed version
mo --help # Show help
mo --version # Show installed version
mole clean -DryRun # Preview the cleanup plan
mole clean -Whitelist # Manage protected caches
mole clean -DryRun -Debug # Detailed preview with risk levels
mo clean --dry-run # Preview the cleanup plan
mo clean --whitelist # Manage protected caches
mo clean --dry-run --debug # Detailed preview with risk levels
mole optimize -DryRun # Preview optimization actions
mole optimize -Debug # Run with detailed operation logs
mole purge -Paths # Configure project scan directories
mo optimize --dry-run # Preview optimization actions
mo optimize --debug # Run with detailed operation logs
mo purge --paths # Configure project scan directories
```
## Tips
- **Safety**: Built with strict protections. Preview changes with `mole clean -DryRun`.
- **Safety**: Built with strict protections. Preview changes with `mo clean --dry-run`.
- **Be Careful**: Although safe by design, file deletion is permanent. Please review operations carefully.
- **Debug Mode**: Use `-Debug` for detailed logs (e.g., `mole clean -Debug`). Combine with `-DryRun` for comprehensive preview including risk levels and file details.
- **Debug Mode**: Use `--debug` for detailed logs (e.g., `mo clean --debug`). Combine with `--dry-run` for comprehensive preview including risk levels and file details.
- **Navigation**: Supports arrow keys for TUI navigation.
- **Configuration**: Use `mole clean -Whitelist` to manage protected paths, `mole purge -Paths` to configure scan directories.
- **Configuration**: Use `mo clean --whitelist` to manage protected paths, `mo purge --paths` to configure scan directories.
## Features in Detail
### Deep System Cleanup
```powershell
mole clean
mo clean
```
```
@@ -115,7 +115,7 @@ Space freed: 56.1GB | Free space now: 180.3GB
### Smart App Uninstaller
```powershell
mole uninstall
mo uninstall
```
```
@@ -141,7 +141,7 @@ Space freed: 4.8GB
### System Optimization
```powershell
mole optimize
mo optimize
```
```
@@ -162,7 +162,7 @@ System optimization completed
### Disk Space Analyzer
```powershell
mole analyze
mo analyze
```
```
@@ -182,7 +182,7 @@ Analyze Disk C:\Users\YourName\Documents | Total: 156.8GB
Real-time dashboard with system health score, hardware info, and performance metrics.
```powershell
mole status
mo status
```
```
@@ -212,7 +212,7 @@ Health score based on CPU, memory, disk, temperature, and I/O load. Color-coded
Clean old build artifacts (`node_modules`, `target`, `build`, `dist`, etc.) from your projects to free up disk space.
```powershell
mole purge
mo purge
```
```
@@ -230,7 +230,7 @@ Select Categories to Clean - 18.5GB (8 selected)
Use with caution: This will permanently delete selected artifacts. Review carefully before confirming. Recent projects — less than 7 days old — are marked and unselected by default.
Custom scan paths can be configured with `mole purge -Paths`.
Custom scan paths can be configured with `mo purge --paths`.
## Installation Options

View File

@@ -5,6 +5,8 @@
param(
[Parameter(Position = 0)]
[string]$Path,
[Alias('h')]
[switch]$ShowHelp
)
@@ -19,13 +21,13 @@ $binPath = Join-Path $windowsDir "bin\analyze.exe"
function Show-AnalyzeHelp {
$esc = [char]27
Write-Host ""
Write-Host "$esc[1;35mMole Analyze$esc[0m - Interactive disk space analyzer"
Write-Host "$esc[1;35mmo analyze$esc[0m - Interactive disk space analyzer"
Write-Host ""
Write-Host "$esc[33mUsage:$esc[0m mole analyze [path]"
Write-Host "$esc[33mUsage:$esc[0m mo analyze [path]"
Write-Host ""
Write-Host "$esc[33mOptions:$esc[0m"
Write-Host " [path] Path to analyze (default: user profile)"
Write-Host " -ShowHelp Show this help message"
Write-Host " [path] Path to analyze (default: user profile)"
Write-Host " --help Show this help message"
Write-Host ""
Write-Host "$esc[33mKeybindings:$esc[0m"
Write-Host " Up/Down Navigate entries"

View File

@@ -4,11 +4,22 @@
#Requires -Version 5.1
[CmdletBinding()]
param(
[Alias('dry-run')]
[switch]$DryRun,
[Alias('s')]
[switch]$System,
[Alias('game-media')]
[switch]$GameMedia,
[Alias('d')]
[switch]$DebugMode,
[Alias('w')]
[switch]$Whitelist,
[Alias('h')]
[switch]$ShowHelp
)
@@ -45,23 +56,23 @@ $script:ExportListFile = "$env:USERPROFILE\.config\mole\clean-list.txt"
function Show-CleanHelp {
$esc = [char]27
Write-Host ""
Write-Host "$esc[1;35mMole Clean$esc[0m - Deep cleanup for Windows"
Write-Host "$esc[1;35mmo clean$esc[0m - Deep cleanup for Windows"
Write-Host ""
Write-Host "$esc[33mUsage:$esc[0m mole clean [options]"
Write-Host "$esc[33mUsage:$esc[0m mo clean [options]"
Write-Host ""
Write-Host "$esc[33mOptions:$esc[0m"
Write-Host " -DryRun Preview changes without deleting (recommended first run)"
Write-Host " -System Include system-level cleanup (requires admin)"
Write-Host " -GameMedia Clean old game replays, screenshots, recordings (>90d)"
Write-Host " -Whitelist Manage protected paths"
Write-Host " -DebugMode Enable debug logging"
Write-Host " -ShowHelp Show this help message"
Write-Host " --dry-run Preview changes without deleting (recommended first run)"
Write-Host " --system Include system-level cleanup (requires admin)"
Write-Host " --game-media Clean old game replays, screenshots, recordings (>90d)"
Write-Host " --whitelist Manage protected paths"
Write-Host " --debug Enable debug logging"
Write-Host " --help Show this help message"
Write-Host ""
Write-Host "$esc[33mExamples:$esc[0m"
Write-Host " mole clean -DryRun # Preview what would be cleaned"
Write-Host " mole clean # Run standard cleanup"
Write-Host " mole clean -GameMedia # Include old game media cleanup"
Write-Host " mole clean -System # Include system cleanup (as admin)"
Write-Host " mo clean --dry-run # Preview what would be cleaned"
Write-Host " mo clean # Run standard cleanup"
Write-Host " mo clean --game-media # Include old game media cleanup"
Write-Host " mo clean --system # Include system cleanup (as admin)"
Write-Host ""
}
@@ -134,7 +145,7 @@ function Show-CleanupSummary {
Write-Host " Categories: $($Stats.TotalItems)"
Write-Host ""
Write-Host " Detailed list: $esc[90m$($script:ExportListFile)$esc[0m"
Write-Host " Run without -DryRun to apply cleanup"
Write-Host " Run without --dry-run to apply cleanup"
}
else {
Write-Host " Space freed: $esc[32m${sizeGB}GB$esc[0m"
@@ -192,14 +203,14 @@ function Start-Cleanup {
#
# How to protect files:
# 1. Copy any path below to $($script:Config.WhitelistFile)
# 2. Run: mole clean -Whitelist
# 2. Run: mo clean --whitelist
#
"@
Set-Content -Path $script:ExportListFile -Value $header
}
else {
Write-Host "$esc[90m$($script:Icons.Solid) Use -DryRun to preview, -Whitelist to manage protected paths$esc[0m"
Write-Host "$esc[90m$($script:Icons.Solid) Use --dry-run to preview, --whitelist to manage protected paths$esc[0m"
Write-Host ""
}

View File

@@ -4,15 +4,14 @@
#Requires -Version 5.1
[CmdletBinding()]
param(
[Alias('dry-run')]
[switch]$DryRun,
[Alias('d')]
[switch]$DebugMode,
[switch]$ShowHelp,
# Repair options
[switch]$Repair,
[switch]$Font,
[switch]$Icon,
[switch]$Search,
[switch]$Store
[Alias('h')]
[switch]$ShowHelp
)
Set-StrictMode -Version Latest
@@ -33,7 +32,6 @@ $libDir = Join-Path (Split-Path -Parent $scriptDir) "lib"
# ============================================================================
$script:OptimizationsApplied = 0
$script:RepairsApplied = 0
$script:IssuesFound = 0
$script:IssuesFixed = 0
@@ -44,37 +42,31 @@ $script:IssuesFixed = 0
function Show-OptimizeHelp {
$esc = [char]27
Write-Host ""
Write-Host "$esc[1;35mMole Optimize$esc[0m - System optimization, health checks, and repairs"
Write-Host "$esc[1;35mmo optimize$esc[0m - System optimization and maintenance"
Write-Host ""
Write-Host "$esc[33mUsage:$esc[0m mole optimize [options]"
Write-Host "$esc[33mUsage:$esc[0m mo optimize [options]"
Write-Host ""
Write-Host "$esc[33mOptions:$esc[0m"
Write-Host " -DryRun Preview changes without applying"
Write-Host " -DebugMode Enable debug logging"
Write-Host " -ShowHelp Show this help message"
Write-Host " --dry-run Preview changes without applying"
Write-Host " --debug Enable debug logging"
Write-Host " --help Show this help message"
Write-Host ""
Write-Host "$esc[33mRepair Options:$esc[0m"
Write-Host " -Repair Run all repairs (Font, Icon, Search, Store)"
Write-Host " -Font Rebuild font cache (fixes font display issues)"
Write-Host " -Icon Rebuild icon cache (fixes missing/corrupt icons)"
Write-Host " -Search Reset Windows Search index (fixes search issues)"
Write-Host " -Store Reset Windows Store cache (fixes Store issues)"
Write-Host ""
Write-Host "$esc[33mExamples:$esc[0m"
Write-Host " mole optimize # Run standard optimizations"
Write-Host " mole optimize -Repair # Run optimizations + all repairs"
Write-Host " mole optimize -Icon -Font # Run optimizations + specific repairs"
Write-Host " mole optimize -DryRun # Preview what would happen"
Write-Host ""
Write-Host "$esc[33mOptimizations (always run):$esc[0m"
Write-Host " - Disk defragmentation/TRIM (SSD optimization)"
Write-Host " - Windows Search index check"
Write-Host "$esc[33mWhat it does:$esc[0m"
Write-Host " - Disk optimization (TRIM for SSD, defrag for HDD)"
Write-Host " - DNS cache flush"
Write-Host " - Network optimization"
Write-Host " - Network stack optimization"
Write-Host " - Font cache rebuild"
Write-Host " - Icon cache rebuild"
Write-Host " - Windows Search optimization"
Write-Host " - Windows Store cache reset"
Write-Host " - Startup program analysis"
Write-Host " - Disk health check"
Write-Host " - Windows Update status"
Write-Host ""
Write-Host "$esc[33mExamples:$esc[0m"
Write-Host " mo optimize # Run all optimizations"
Write-Host " mo optimize --dry-run # Preview what would happen"
Write-Host ""
}
# ============================================================================
@@ -495,7 +487,7 @@ function Repair-FontCache {
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would stop Windows Font Cache Service"
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would delete font cache files"
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would restart Windows Font Cache Service"
$script:RepairsApplied++
$script:OptimizationsApplied++
return
}
@@ -528,7 +520,7 @@ function Repair-FontCache {
Write-Host " $esc[32m$($script:Icons.Success)$esc[0m Font cache rebuilt successfully"
Write-Host " $esc[90mNote: Some apps may need restart to see changes$esc[0m"
$script:RepairsApplied++
$script:OptimizationsApplied++
}
catch {
Write-Host " $esc[31m$($script:Icons.Error)$esc[0m Could not rebuild font cache: $_"
@@ -556,7 +548,7 @@ function Repair-IconCache {
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would stop Explorer"
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would delete icon cache files (iconcache_*.db)"
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would restart Explorer"
$script:RepairsApplied++
$script:OptimizationsApplied++
return
}
@@ -591,7 +583,7 @@ function Repair-IconCache {
Write-Host " $esc[32m$($script:Icons.Success)$esc[0m Icon cache rebuilt ($deletedCount files cleared)"
Write-Host " $esc[90mNote: Icons will rebuild gradually as you browse$esc[0m"
$script:RepairsApplied++
$script:OptimizationsApplied++
}
catch {
Write-Host " $esc[31m$($script:Icons.Error)$esc[0m Could not rebuild icon cache: $_"
@@ -624,7 +616,7 @@ function Repair-SearchIndex {
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would stop Windows Search service"
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would delete search index database"
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would restart Windows Search service"
$script:RepairsApplied++
$script:OptimizationsApplied++
return
}
@@ -643,7 +635,7 @@ function Repair-SearchIndex {
Write-Host " $esc[32m$($script:Icons.Success)$esc[0m Search index reset successfully"
Write-Host " $esc[33m$($script:Icons.Warning)$esc[0m Indexing will rebuild in the background (may take hours)"
$script:RepairsApplied++
$script:OptimizationsApplied++
}
catch {
Write-Host " $esc[31m$($script:Icons.Error)$esc[0m Could not reset search index: $_"
@@ -667,7 +659,7 @@ function Repair-StoreCache {
if ($script:DryRun) {
Write-Host " $esc[33m$($script:Icons.DryRun)$esc[0m Would run wsreset.exe"
$script:RepairsApplied++
$script:OptimizationsApplied++
return
}
@@ -682,7 +674,7 @@ function Repair-StoreCache {
else {
Write-Host " $esc[33m$($script:Icons.Warning)$esc[0m wsreset completed with code $($wsreset.ExitCode)"
}
$script:RepairsApplied++
$script:OptimizationsApplied++
}
catch {
Write-Host " $esc[31m$($script:Icons.Error)$esc[0m Could not reset Store cache: $_"
@@ -708,20 +700,12 @@ function Show-OptimizeSummary {
Write-Host ""
if ($script:DryRun) {
$total = $script:OptimizationsApplied + $script:RepairsApplied
Write-Host " Would apply $esc[33m$total$esc[0m changes"
if ($script:RepairsApplied -gt 0) {
Write-Host " ($($script:OptimizationsApplied) optimizations, $($script:RepairsApplied) repairs)"
}
Write-Host " Run without -DryRun to apply changes"
Write-Host " Would apply $esc[33m$($script:OptimizationsApplied)$esc[0m optimizations"
Write-Host " Run without --dry-run to apply changes"
}
else {
Write-Host " Optimizations applied: $esc[32m$($script:OptimizationsApplied)$esc[0m"
if ($script:RepairsApplied -gt 0) {
Write-Host " Repairs applied: $esc[32m$($script:RepairsApplied)$esc[0m"
}
if ($script:IssuesFixed -gt 0) {
Write-Host " Issues fixed: $esc[32m$($script:IssuesFixed)$esc[0m"
}
@@ -757,15 +741,12 @@ function Main {
# Set dry-run mode
$script:DryRun = $DryRun
# Check if any repairs were requested
$runRepairs = $Repair -or $Font -or $Icon -or $Search -or $Store
# Clear screen
Clear-Host
$esc = [char]27
Write-Host ""
Write-Host "$esc[1;35mOptimize and Check$esc[0m"
Write-Host "$esc[1;35mOptimize and Maintain$esc[0m"
Write-Host ""
if ($script:DryRun) {
@@ -779,46 +760,20 @@ function Main {
# Run optimizations
Optimize-DiskDrive
Optimize-SearchIndex
Clear-DnsCache
Optimize-Network
# Run cache rebuilds (repairs integrated into optimize)
Repair-FontCache
Repair-IconCache
Optimize-SearchIndex
Repair-StoreCache
# Run health checks
Get-StartupPrograms
Test-DiskHealth
Test-WindowsUpdate
# Run repairs if requested
if ($runRepairs) {
Write-Host ""
Write-Host "$esc[1;35m$($script:Icons.Arrow) Repairs$esc[0m"
if ($Repair -or $Font) {
Repair-FontCache
}
if ($Repair -or $Icon) {
Repair-IconCache
}
if ($Repair -or $Search) {
Repair-SearchIndex
}
if ($Repair -or $Store) {
Repair-StoreCache
}
}
# System file check is slow, ask first (only if not doing repairs)
if (-not $runRepairs -and -not $script:DryRun -and (Test-IsAdmin)) {
Write-Host ""
$runSfc = Read-Host "Run System File Checker? This may take several minutes (y/N)"
if ($runSfc -eq 'y' -or $runSfc -eq 'Y') {
Test-SystemFiles
}
}
# Summary
Show-OptimizeSummary
}

View File

@@ -4,8 +4,13 @@
#Requires -Version 5.1
[CmdletBinding()]
param(
[Alias('d')]
[switch]$DebugMode,
[Alias('p')]
[switch]$Paths,
[Alias('h')]
[switch]$ShowHelp
)
@@ -74,14 +79,14 @@ $script:ItemsCleaned = 0
function Show-PurgeHelp {
$esc = [char]27
Write-Host ""
Write-Host "$esc[1;35mMole Purge$esc[0m - Clean project build artifacts"
Write-Host "$esc[1;35mmo purge$esc[0m - Clean project build artifacts"
Write-Host ""
Write-Host "$esc[33mUsage:$esc[0m mole purge [options]"
Write-Host "$esc[33mUsage:$esc[0m mo purge [options]"
Write-Host ""
Write-Host "$esc[33mOptions:$esc[0m"
Write-Host " -Paths Edit custom scan directories"
Write-Host " -DebugMode Enable debug logging"
Write-Host " -ShowHelp Show this help message"
Write-Host " --paths Edit custom scan directories"
Write-Host " --debug Enable debug logging"
Write-Host " --help Show this help message"
Write-Host ""
Write-Host "$esc[33mDefault Search Paths:$esc[0m"
foreach ($path in $script:DefaultSearchPaths) {
@@ -550,7 +555,7 @@ function Main {
if ($null -eq $searchPaths -or $searchPaths.Count -eq 0) {
Write-MoleWarning "No valid search paths found"
Write-Host "Run 'mole purge -Paths' to configure search directories"
Write-Host "Run 'mo purge --paths' to configure search directories"
return
}

View File

@@ -3,6 +3,7 @@
#Requires -Version 5.1
param(
[Alias('h')]
[switch]$ShowHelp
)
@@ -17,12 +18,12 @@ $binPath = Join-Path $windowsDir "bin\status.exe"
function Show-StatusHelp {
$esc = [char]27
Write-Host ""
Write-Host "$esc[1;35mMole Status$esc[0m - Real-time system health monitor"
Write-Host "$esc[1;35mmo status$esc[0m - Real-time system health monitor"
Write-Host ""
Write-Host "$esc[33mUsage:$esc[0m mole status"
Write-Host "$esc[33mUsage:$esc[0m mo status"
Write-Host ""
Write-Host "$esc[33mOptions:$esc[0m"
Write-Host " -ShowHelp Show this help message"
Write-Host " --help Show this help message"
Write-Host ""
Write-Host "$esc[33mDisplays:$esc[0m"
Write-Host " - System health score (0-100)"

View File

@@ -4,8 +4,13 @@
#Requires -Version 5.1
[CmdletBinding()]
param(
[Alias('d')]
[switch]$DebugMode,
[Alias('r')]
[switch]$Rescan,
[Alias('h')]
[switch]$ShowHelp
)
@@ -37,14 +42,14 @@ $script:CacheTTLHours = 24
function Show-UninstallHelp {
$esc = [char]27
Write-Host ""
Write-Host "$esc[1;35mMole Uninstall$esc[0m - Interactive application uninstaller"
Write-Host "$esc[1;35mmo uninstall$esc[0m - Interactive application uninstaller"
Write-Host ""
Write-Host "$esc[33mUsage:$esc[0m mole uninstall [options]"
Write-Host "$esc[33mUsage:$esc[0m mo uninstall [options]"
Write-Host ""
Write-Host "$esc[33mOptions:$esc[0m"
Write-Host " -Rescan Force rescan of installed applications"
Write-Host " -DebugMode Enable debug logging"
Write-Host " -ShowHelp Show this help message"
Write-Host " --rescan Force rescan of installed applications"
Write-Host " --debug Enable debug logging"
Write-Host " --help Show this help message"
Write-Host ""
Write-Host "$esc[33mFeatures:$esc[0m"
Write-Host " - Scans installed programs from registry and Windows Apps"

View File

@@ -318,6 +318,11 @@ powershell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "& '%MOLE_DIR
$batchPath = Join-Path $InstallDir "mole.cmd"
Set-Content -Path $batchPath -Value $batchContent -Encoding ASCII
Write-Success "Created launcher: mole.cmd"
# Also create 'mo' alias
$moPath = Join-Path $InstallDir "mo.cmd"
Set-Content -Path $moPath -Value $batchContent -Encoding ASCII
Write-Success "Created launcher: mo.cmd (short alias)"
# Add to PATH if requested
if ($AddToPath) {
@@ -339,7 +344,7 @@ powershell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "& '%MOLE_DIR
Write-Host ""
if ($AddToPath) {
Write-Host " Run 'mole' from any terminal to start"
Write-Host " Run 'mo' or 'mole' from any terminal to start"
}
else {
Write-Host " Run the following to start:"

View File

@@ -10,7 +10,10 @@ param(
[Parameter(Position = 1, ValueFromRemainingArguments)]
[string[]]$CommandArgs,
[Alias('v')]
[switch]$Version,
[Alias('h')]
[switch]$ShowHelp
)
@@ -66,28 +69,27 @@ function Show-MainHelp {
Write-Host ""
Write-Host " ${green}OPTIONS:${nc}"
Write-Host ""
Write-Host " ${cyan}-Version${nc} Show version information"
Write-Host " ${cyan}-ShowHelp${nc} Show this help message"
Write-Host " ${cyan}--version${nc} Show version information"
Write-Host " ${cyan}--help${nc} Show this help message"
Write-Host ""
Write-Host " ${green}EXAMPLES:${nc}"
Write-Host ""
Write-Host " ${gray}mole${nc} ${gray}# Interactive menu${nc}"
Write-Host " ${gray}mole clean${nc} ${gray}# Deep cleanup${nc}"
Write-Host " ${gray}mole clean -DryRun${nc} ${gray}# Preview cleanup${nc}"
Write-Host " ${gray}mole uninstall${nc} ${gray}# Uninstall apps${nc}"
Write-Host " ${gray}mole analyze${nc} ${gray}# Disk analyzer${nc}"
Write-Host " ${gray}mole status${nc} ${gray}# System monitor${nc}"
Write-Host " ${gray}mole optimize${nc} ${gray}# Optimize system${nc}"
Write-Host " ${gray}mole optimize -Repair${nc} ${gray}# Optimize + all repairs${nc}"
Write-Host " ${gray}mole optimize -Icon${nc} ${gray}# Optimize + rebuild icons${nc}"
Write-Host " ${gray}mole 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 uninstall${nc} ${gray}# Uninstall apps${nc}"
Write-Host " ${gray}mo analyze${nc} ${gray}# Disk analyzer${nc}"
Write-Host " ${gray}mo status${nc} ${gray}# System monitor${nc}"
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 ""
Write-Host " ${green}ENVIRONMENT:${nc}"
Write-Host ""
Write-Host " ${cyan}MOLE_DRY_RUN=1${nc} Preview without changes"
Write-Host " ${cyan}MOLE_DEBUG=1${nc} Enable debug output"
Write-Host ""
Write-Host " ${gray}Run '${nc}mole <command> -ShowHelp${gray}' for command-specific help${nc}"
Write-Host " ${gray}Run '${nc}mo <command> --help${gray}' for command-specific help${nc}"
Write-Host ""
}
@@ -240,13 +242,13 @@ function Main {
$effectiveVersion = $Version
$effectiveCommand = $Command
if ($Command -match '^-(.+)$') {
$switchName = $Matches[1]
if ($Command -match '^-{1,2}(.+)$') {
$switchName = $Matches[1].ToLower()
switch ($switchName) {
'ShowHelp' { $effectiveShowHelp = $true; $effectiveCommand = $null }
'Help' { $effectiveShowHelp = $true; $effectiveCommand = $null }
'showhelp' { $effectiveShowHelp = $true; $effectiveCommand = $null }
'help' { $effectiveShowHelp = $true; $effectiveCommand = $null }
'h' { $effectiveShowHelp = $true; $effectiveCommand = $null }
'Version' { $effectiveVersion = $true; $effectiveCommand = $null }
'version' { $effectiveVersion = $true; $effectiveCommand = $null }
'v' { $effectiveVersion = $true; $effectiveCommand = $null }
}
}
@@ -274,7 +276,7 @@ function Main {
Write-MoleError "Unknown command: $effectiveCommand"
Write-Host ""
Write-Host "Available commands: $($validCommands -join ', ')"
Write-Host "Run 'mole -ShowHelp' for more information"
Write-Host "Run 'mo --help' for more information"
}
return
}