From 67cca9854f22afaa20c0bf9ebb1367f2288f7494 Mon Sep 17 00:00:00 2001 From: pynezz Date: Sat, 11 Oct 2025 05:03:12 +0200 Subject: [PATCH] Add README.md contents --- README.md | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/README.md b/README.md index e69de29..9407db7 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,91 @@ +# Bash Argument Parser Generator + +A self-contained web application for interactively building bash argument parsing code. Zero external dependencies - single binary deployment. + +## Features + +- **Zero Dependencies**: Single Go binary with embedded assets +- **Real-time Help Preview**: See generated help output as you type +- **Clean Separation**: Frontend assets organized in separate directories +- **Auto-expanding Rows**: New input rows appear automatically +- **Dark Terminal Theme**: Professional terminal-style interface +- **Copy to Clipboard**: One-click script copying + +## Architecture + +``` +argparse-builder/ +├── main.go # Go server with embedded FS +├── static/ +│ ├── css/ +│ │ └── style.css # Styling +│ └── js/ +│ └── app.js # Frontend logic +└── templates/ + └── index.html # HTML template +``` + +All files are embedded using `//go:embed` directive, resulting in a single binary. + +## Build + +```bash +go build -o argparse-builder +``` + +## Run + +```bash +./argparse-builder +``` + +Server starts on port 8080. Open http://localhost:8080 in your browser. +Demo available at: https://pages.git.pynezz.dev/argparse-builder + +## Usage + +1. **Add Custom Header** (optional): Set a greeting or description +2. **Define Arguments**: + - Parameters: `-v --verbose` (flag syntax) + - Variable Name: `verbose` (internal variable) + - Help Text: Description shown in help output +3. **Real-time Preview**: Help output updates as you type +4. **Generate**: Click "Generate BASH" to create the script +5. **Copy**: Use the copy button to get the generated code + +## Example Output + +For inputs: + +- Header: "My Script v1.0" +- Arguments: `-v --verbose`, `verbose`, "Enable verbose output" + +Generates a complete bash script with: + +- Usage function with formatted help +- Argument parsing with case statements +- Variable initialization +- Unknown option handling +- `-h/--help` support + +## Technical Details + +- **Language**: Go 1.21+ +- **Embedding**: `embed.FS` for asset bundling +- **Binary Size**: ~9MB (includes runtime and all assets) +- **HTTP Server**: Standard library net/http +- **Frontend**: Vanilla JavaScript (no frameworks) + +## Performance + +- Instant startup (no compilation) +- Low memory footprint +- Efficient static file serving from memory +- No external network calls + +## Security Considerations + +- Input sanitization on server side +- No shell execution +- Template-based HTML generation +- CORS headers not set (localhost only by default)