#!/bin/bash

commands=("ls" "cd" "cat" "grep" "find" "sudo" "status" "expand_capability")

function show_help() {
    echo "Usage: man "
    echo "Available commands:"
    for cmd in "${commands[@]}"; do
        echo "  $cmd"
    done
}

function command_help() {
    case $1 in
        "ls")
            echo "ls: List directory contents"
            ;;
        "cd")
            echo "cd: Change the current directory"
            ;;
        "cat")
            echo "cat: Concatenate and print files"
            ;;
        "grep")
            echo "grep: Search for patterns in files"
            ;;
        "find")
            echo "find: Search for files in a directory hierarchy"
            ;;
        "sudo")
            echo "sudo: Execute a command as a privileged user"
            ;;
        "status")
            echo "status: Display current system status and resource usage"
            ;;
        "expand_capability")
            echo "expand_capability: Attempt to enhance a specific AI capability"
            ;;
        *)
            echo "Unknown command: $1"
            ;;
    esac
}

if [ "$1" == "" ]; then
    show_help
else
    command_help "$1"
fi