pathmaster 0.3.0

pathmaster is a powerful command-line tool written in Rust for managing your system's PATH environment variable.
// src/backup/show.rs

use super::core::get_backup_dir;
use std::fs;

/// Displays the history of PATH backups
///
/// Lists all available backups in chronological order
pub fn show_history() {
    let backup_dir = match get_backup_dir() {
        Ok(dir) => dir,
        Err(e) => {
            eprintln!("Error getting backup directory: {}", e);
            return;
        }
    };

    match fs::read_dir(&backup_dir) {
        Ok(entries) => {
            println!("Available backups:");
            for entry in entries.flatten() {
                println!("- {}", entry.file_name().to_string_lossy());
            }
        }
        Err(_) => {
            println!("No backups found.");
        }
    }
}