| 17 | ) |
| 18 | |
| 19 | func usage() { |
| 20 | fmt.Fprintf(os.Stderr, `Test Harness for SSH Connection Flows |
| 21 | |
| 22 | Usage: |
| 23 | test-conn [flags] <command> <user@host> [args...] |
| 24 | |
| 25 | Commands: |
| 26 | connect <user@host> - Test basic SSH connection with wsh |
| 27 | ssh <user@host> - Test basic SSH connection |
| 28 | exec <user@host> <command> - Execute command and show output (no wsh) |
| 29 | wshexec <user@host> <command> - Execute command with wsh enabled |
| 30 | shell <user@host> - Start interactive shell session |
| 31 | |
| 32 | Flags: |
| 33 | -t duration Connection timeout (default: 60s) |
| 34 | -i Interactive mode (prompt for user input instead of auto-accept) |
| 35 | -v Show version and exit |
| 36 | |
| 37 | Examples: |
| 38 | test-conn ssh user@example.com |
| 39 | test-conn exec user@example.com "ls -la" |
| 40 | test-conn wshexec user@example.com "wsh version" |
| 41 | test-conn -i connect user@example.com |
| 42 | test-conn shell user@example.com |
| 43 | |
| 44 | `) |
| 45 | os.Exit(1) |
| 46 | } |
| 47 | |
| 48 | func main() { |
| 49 | timeoutFlag := flag.Duration("t", 60*time.Second, "connection timeout") |