refactor: rebrand bash-helper to super-man + ESC returns straight to menu
Rename bash-helper.sh -> super-man.sh and update all docs/tests to the super-man name and alias. In interactive mode, pressing Esc in the flag browser now returns directly to the home menu, removing the intermediary "Press Enter to search another command" prompt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+14
-14
@@ -1,6 +1,6 @@
|
||||
# Bash Buddy Test Suite
|
||||
# Super Man Test Suite
|
||||
|
||||
Comprehensive testing framework for Bash Buddy with performance analysis and automated reporting.
|
||||
Comprehensive testing framework for Super Man with performance analysis and automated reporting.
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -177,7 +177,7 @@ Interactive HTML dashboard with:
|
||||
|
||||
### Required
|
||||
- **bash** 4.0+ - Shell interpreter
|
||||
- **bash-helper.sh** - Script being tested
|
||||
- **super-man.sh** - Script being tested
|
||||
|
||||
### Optional
|
||||
- **jq** - JSON parsing (for detailed analysis)
|
||||
@@ -210,7 +210,7 @@ brew install jq fzf expect bc
|
||||
**Output:**
|
||||
```
|
||||
═══════════════════════════════════════════════════════════
|
||||
Bash Buddy Test Suite
|
||||
Super Man Test Suite
|
||||
2025-01-XX XX:XX:XX
|
||||
═══════════════════════════════════════════════════════════
|
||||
|
||||
@@ -218,7 +218,7 @@ brew install jq fzf expect bc
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
Test #1: Help display (--help)
|
||||
✓ PASSED (45ms) - Output contains: "Bash Buddy"
|
||||
✓ PASSED (45ms) - Output contains: "Super Man"
|
||||
|
||||
Test #2: List all commands (--list)
|
||||
✓ PASSED (32ms) - Output contains: "Available commands"
|
||||
@@ -257,7 +257,7 @@ Pass Rate: 95%
|
||||
**Output:**
|
||||
```
|
||||
═══════════════════════════════════════════════════════════
|
||||
Bash Buddy Performance Analysis
|
||||
Super Man Performance Analysis
|
||||
2025-01-XX XX:XX:XX
|
||||
═══════════════════════════════════════════════════════════
|
||||
|
||||
@@ -290,7 +290,7 @@ exit $EXIT_CODE
|
||||
### GitHub Actions Example
|
||||
|
||||
```yaml
|
||||
name: Test Bash Buddy
|
||||
name: Test Super Man
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
@@ -444,7 +444,7 @@ print_section "Custom Tests"
|
||||
|
||||
run_test_with_output_check \
|
||||
"My custom test" \
|
||||
"../bash-helper.sh ask 'my query'" \
|
||||
"../super-man.sh ask 'my query'" \
|
||||
"expected output"
|
||||
|
||||
print_summary
|
||||
@@ -498,15 +498,15 @@ Run test and verify output contains expected string.
|
||||
```bash
|
||||
run_test_with_output_check \
|
||||
"Help test" \
|
||||
"./bash-helper.sh --help" \
|
||||
"Bash Buddy"
|
||||
"./super-man.sh --help" \
|
||||
"Super Man"
|
||||
```
|
||||
|
||||
#### `run_benchmark(name, command, iterations)`
|
||||
Run performance benchmark with statistics.
|
||||
|
||||
```bash
|
||||
run_benchmark "Ask mode" "./bash-helper.sh ask 'test'" 10
|
||||
run_benchmark "Ask mode" "./super-man.sh ask 'test'" 10
|
||||
```
|
||||
|
||||
#### `skip_test(name, reason)`
|
||||
@@ -612,7 +612,7 @@ A: Yes, but be careful with shared resources (log files, etc.)
|
||||
A: No, unless installing dependencies
|
||||
|
||||
**Q: Will tests modify my system?**
|
||||
A: No, tests only read/execute bash-helper.sh
|
||||
A: No, tests only read/execute super-man.sh
|
||||
|
||||
**Q: Can I run tests on macOS?**
|
||||
A: Yes, with dependencies installed via Homebrew
|
||||
@@ -632,7 +632,7 @@ A: Check `tests/logs/test_N_*.log` for detailed output
|
||||
|
||||
## License
|
||||
|
||||
Same as Bash Buddy - see main repository
|
||||
Same as Super Man - see main repository
|
||||
|
||||
## Support
|
||||
|
||||
@@ -642,6 +642,6 @@ Same as Bash Buddy - see main repository
|
||||
|
||||
---
|
||||
|
||||
**Bash Buddy Test Suite v1.0.0**
|
||||
**Super Man Test Suite v1.0.0**
|
||||
|
||||
Ensuring quality and performance at every commit! 🚀
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Performance Analysis Tool for Bash Buddy
|
||||
# Performance Analysis Tool for Super Man
|
||||
# Analyzes test logs and benchmark data to generate insights
|
||||
|
||||
# Color definitions
|
||||
@@ -27,7 +27,7 @@ mkdir -p "$REPORT_DIR"
|
||||
print_header() {
|
||||
echo -e "${BOLD}${CYAN}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo " Bash Buddy Performance Analysis"
|
||||
echo " Super Man Performance Analysis"
|
||||
echo " $(date '+%Y-%m-%d %H:%M:%S')"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo -e "${NC}"
|
||||
@@ -59,7 +59,7 @@ generate_performance_report() {
|
||||
local bench_file="$PERF_LOG_DIR/benchmarks.csv"
|
||||
local report_file="$REPORT_DIR/performance-report.md"
|
||||
|
||||
echo "# Bash Buddy Performance Report" > "$report_file"
|
||||
echo "# Super Man Performance Report" > "$report_file"
|
||||
echo "" >> "$report_file"
|
||||
echo "**Generated:** $(date '+%Y-%m-%d %H:%M:%S')" >> "$report_file"
|
||||
echo "" >> "$report_file"
|
||||
@@ -188,7 +188,7 @@ generate_html_report() {
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Bash Buddy Performance Report</title>
|
||||
<title>Super Man Performance Report</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
||||
@@ -243,7 +243,7 @@ generate_html_report() {
|
||||
</head>
|
||||
<body>
|
||||
<div class="header">
|
||||
<h1>🚀 Bash Buddy Performance Report</h1>
|
||||
<h1>🚀 Super Man Performance Report</h1>
|
||||
<p>Generated: TIMESTAMP</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Master Test Runner for Bash Buddy
|
||||
# Master Test Runner for Super Man
|
||||
# Runs all test suites and generates comprehensive reports
|
||||
|
||||
# Color definitions
|
||||
@@ -83,12 +83,12 @@ print_banner
|
||||
print_section "Pre-flight Checks"
|
||||
|
||||
# Check if script exists
|
||||
if [ ! -f "$PROJECT_DIR/bash-helper.sh" ]; then
|
||||
echo -e "${RED}Error: bash-helper.sh not found${NC}"
|
||||
if [ ! -f "$PROJECT_DIR/super-man.sh" ]; then
|
||||
echo -e "${RED}Error: super-man.sh not found${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}✓ bash-helper.sh found${NC}"
|
||||
echo -e "${GREEN}✓ super-man.sh found${NC}"
|
||||
|
||||
# Check dependencies
|
||||
MISSING_DEPS=()
|
||||
@@ -224,7 +224,7 @@ fi
|
||||
# Generate CI-friendly output
|
||||
CI_REPORT="$SCRIPT_DIR/reports/ci-report.txt"
|
||||
cat > "$CI_REPORT" << EOF
|
||||
Bash Buddy Test Results
|
||||
Super Man Test Results
|
||||
========================
|
||||
Date: $(date '+%Y-%m-%d %H:%M:%S')
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Comprehensive test suite for all Bash Buddy operating modes
|
||||
# Comprehensive test suite for all Super Man operating modes
|
||||
# Tests all non-interactive modes with performance analysis
|
||||
|
||||
# Get script directory
|
||||
@@ -10,11 +10,11 @@ PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
source "$SCRIPT_DIR/test-framework.sh"
|
||||
|
||||
# Set script path
|
||||
SCRIPT_PATH="$PROJECT_DIR/bash-helper.sh"
|
||||
SCRIPT_PATH="$PROJECT_DIR/super-man.sh"
|
||||
|
||||
# Verify script exists
|
||||
if [ ! -f "$SCRIPT_PATH" ]; then
|
||||
echo -e "${RED}Error: bash-helper.sh not found at $SCRIPT_PATH${NC}"
|
||||
echo -e "${RED}Error: super-man.sh not found at $SCRIPT_PATH${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -34,7 +34,7 @@ print_section "Help & Informational Modes"
|
||||
run_test_with_output_check \
|
||||
"Help display (--help)" \
|
||||
"$SCRIPT_PATH --help" \
|
||||
"Bash Buddy"
|
||||
"Super Man"
|
||||
|
||||
run_test_with_output_check \
|
||||
"Help display (-h)" \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Bash Buddy Test Framework
|
||||
# Super Man Test Framework
|
||||
# Provides utilities for testing all operating modes with performance analysis
|
||||
|
||||
# Color definitions
|
||||
@@ -25,7 +25,7 @@ declare -A TEST_RESULTS
|
||||
# Configuration
|
||||
TEST_LOG_DIR="./tests/logs"
|
||||
PERF_LOG_DIR="./tests/performance"
|
||||
SCRIPT_PATH="./bash-helper.sh"
|
||||
SCRIPT_PATH="./super-man.sh"
|
||||
|
||||
# Create directories
|
||||
mkdir -p "$TEST_LOG_DIR"
|
||||
@@ -45,7 +45,7 @@ get_ms_timestamp() {
|
||||
print_header() {
|
||||
echo -e "${BOLD}${CYAN}"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo " Bash Buddy Test Suite"
|
||||
echo " Super Man Test Suite"
|
||||
echo " $(get_timestamp)"
|
||||
echo "═══════════════════════════════════════════════════════════"
|
||||
echo -e "${NC}"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Interactive mode testing for Bash Buddy
|
||||
# Interactive mode testing for Super Man
|
||||
# Tests fzf-based interactive mode with automation
|
||||
|
||||
# Get script directory
|
||||
@@ -10,7 +10,7 @@ PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
||||
source "$SCRIPT_DIR/test-framework.sh"
|
||||
|
||||
# Set script path
|
||||
SCRIPT_PATH="$PROJECT_DIR/bash-helper.sh"
|
||||
SCRIPT_PATH="$PROJECT_DIR/super-man.sh"
|
||||
|
||||
print_header
|
||||
echo "Testing Interactive Mode"
|
||||
@@ -51,12 +51,12 @@ echo -e "\n${CYAN}Test #1: Launch interactive mode and exit immediately${NC}"
|
||||
TEST_LOG="$TEST_LOG_DIR/interactive_launch_test.log"
|
||||
|
||||
# Create expect script for immediate exit
|
||||
cat > /tmp/bhelper_test_exit.exp << 'EOF'
|
||||
cat > /tmp/super-man_test_exit.exp << 'EOF'
|
||||
#!/usr/bin/expect -f
|
||||
set timeout 10
|
||||
log_user 0
|
||||
|
||||
spawn bash -c "./bash-helper.sh"
|
||||
spawn bash -c "./super-man.sh"
|
||||
expect {
|
||||
timeout { exit 1 }
|
||||
eof { exit 0 }
|
||||
@@ -68,11 +68,11 @@ expect {
|
||||
}
|
||||
EOF
|
||||
|
||||
chmod +x /tmp/bhelper_test_exit.exp
|
||||
chmod +x /tmp/super-man_test_exit.exp
|
||||
|
||||
cd "$PROJECT_DIR"
|
||||
start_time=$(get_ms_timestamp)
|
||||
/tmp/bhelper_test_exit.exp > "$TEST_LOG" 2>&1
|
||||
/tmp/super-man_test_exit.exp > "$TEST_LOG" 2>&1
|
||||
exit_code=$?
|
||||
end_time=$(get_ms_timestamp)
|
||||
duration=$((end_time - start_time))
|
||||
@@ -98,12 +98,12 @@ echo -e "\n${CYAN}Test #2: Select command and view flags${NC}"
|
||||
TEST_LOG="$TEST_LOG_DIR/interactive_select_test.log"
|
||||
|
||||
# Create expect script to select grep and search for -v
|
||||
cat > /tmp/bhelper_test_select.exp << 'EOF'
|
||||
cat > /tmp/super-man_test_select.exp << 'EOF'
|
||||
#!/usr/bin/expect -f
|
||||
set timeout 15
|
||||
log_user 1
|
||||
|
||||
spawn bash -c "./bash-helper.sh"
|
||||
spawn bash -c "./super-man.sh"
|
||||
|
||||
# Wait for fzf to start
|
||||
sleep 2
|
||||
@@ -126,11 +126,11 @@ send "\x03"
|
||||
expect eof
|
||||
EOF
|
||||
|
||||
chmod +x /tmp/bhelper_test_select.exp
|
||||
chmod +x /tmp/super-man_test_select.exp
|
||||
|
||||
cd "$PROJECT_DIR"
|
||||
start_time=$(get_ms_timestamp)
|
||||
/tmp/bhelper_test_select.exp > "$TEST_LOG" 2>&1
|
||||
/tmp/super-man_test_select.exp > "$TEST_LOG" 2>&1
|
||||
exit_code=$?
|
||||
end_time=$(get_ms_timestamp)
|
||||
duration=$((end_time - start_time))
|
||||
@@ -157,12 +157,12 @@ echo -e "\n${CYAN}Test #3: Filter commands by category${NC}"
|
||||
TEST_LOG="$TEST_LOG_DIR/interactive_filter_test.log"
|
||||
|
||||
# Create expect script to filter by "network"
|
||||
cat > /tmp/bhelper_test_filter.exp << 'EOF'
|
||||
cat > /tmp/super-man_test_filter.exp << 'EOF'
|
||||
#!/usr/bin/expect -f
|
||||
set timeout 15
|
||||
log_user 1
|
||||
|
||||
spawn bash -c "./bash-helper.sh"
|
||||
spawn bash -c "./super-man.sh"
|
||||
|
||||
# Wait for fzf to start
|
||||
sleep 2
|
||||
@@ -179,11 +179,11 @@ send "\x03"
|
||||
expect eof
|
||||
EOF
|
||||
|
||||
chmod +x /tmp/bhelper_test_filter.exp
|
||||
chmod +x /tmp/super-man_test_filter.exp
|
||||
|
||||
cd "$PROJECT_DIR"
|
||||
start_time=$(get_ms_timestamp)
|
||||
/tmp/bhelper_test_filter.exp > "$TEST_LOG" 2>&1
|
||||
/tmp/super-man_test_filter.exp > "$TEST_LOG" 2>&1
|
||||
exit_code=$?
|
||||
end_time=$(get_ms_timestamp)
|
||||
duration=$((end_time - start_time))
|
||||
@@ -213,12 +213,12 @@ SUCCESS_COUNT=0
|
||||
for cmd in "${COMMANDS_TO_TEST[@]}"; do
|
||||
TEST_LOG="$TEST_LOG_DIR/interactive_${cmd}_test.log"
|
||||
|
||||
cat > /tmp/bhelper_test_${cmd}.exp << EOF
|
||||
cat > /tmp/super-man_test_${cmd}.exp << EOF
|
||||
#!/usr/bin/expect -f
|
||||
set timeout 10
|
||||
log_user 1
|
||||
|
||||
spawn bash -c "./bash-helper.sh"
|
||||
spawn bash -c "./super-man.sh"
|
||||
sleep 2
|
||||
send "${cmd}\r"
|
||||
sleep 1
|
||||
@@ -228,10 +228,10 @@ send "\x03"
|
||||
expect eof
|
||||
EOF
|
||||
|
||||
chmod +x /tmp/bhelper_test_${cmd}.exp
|
||||
chmod +x /tmp/super-man_test_${cmd}.exp
|
||||
|
||||
cd "$PROJECT_DIR"
|
||||
/tmp/bhelper_test_${cmd}.exp > "$TEST_LOG" 2>&1
|
||||
/tmp/super-man_test_${cmd}.exp > "$TEST_LOG" 2>&1
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
SUCCESS_COUNT=$((SUCCESS_COUNT + 1))
|
||||
@@ -267,22 +267,22 @@ SUCCESS_COUNT=0
|
||||
for i in {1..5}; do
|
||||
TEST_LOG="$TEST_LOG_DIR/interactive_perf_$i.log"
|
||||
|
||||
cat > /tmp/bhelper_perf_test.exp << 'EOF'
|
||||
cat > /tmp/super-man_perf_test.exp << 'EOF'
|
||||
#!/usr/bin/expect -f
|
||||
set timeout 10
|
||||
log_user 0
|
||||
|
||||
spawn bash -c "./bash-helper.sh"
|
||||
spawn bash -c "./super-man.sh"
|
||||
sleep 1
|
||||
send "\x03"
|
||||
expect eof
|
||||
EOF
|
||||
|
||||
chmod +x /tmp/bhelper_perf_test.exp
|
||||
chmod +x /tmp/super-man_perf_test.exp
|
||||
|
||||
cd "$PROJECT_DIR"
|
||||
start_time=$(get_ms_timestamp)
|
||||
/tmp/bhelper_perf_test.exp > "$TEST_LOG" 2>&1
|
||||
/tmp/super-man_perf_test.exp > "$TEST_LOG" 2>&1
|
||||
exit_code=$?
|
||||
end_time=$(get_ms_timestamp)
|
||||
duration=$((end_time - start_time))
|
||||
@@ -306,7 +306,7 @@ if [ $SUCCESS_COUNT -gt 0 ]; then
|
||||
fi
|
||||
|
||||
# Cleanup temp files
|
||||
rm -f /tmp/bhelper_*.exp
|
||||
rm -f /tmp/super-man_*.exp
|
||||
|
||||
# ============================================================================
|
||||
# SUMMARY
|
||||
|
||||
Reference in New Issue
Block a user