Add slogan, donations, and --help options to C implementation tools

- Added 'Protect the dolls!' slogan to all C tools
- Added BTC and ETH donation addresses to all C tools
- Implemented --help (-h) option for all C tools (wssshc, wsssh, wsscp)
- Updated configure.sh to generate Makefile with man pages support
- All C tools now display help information and donation details
- Consistent branding and community support across implementations
parent 9b3855df
...@@ -44,6 +44,9 @@ SRCS = wssshc.c wsssh.c wsscp.c ...@@ -44,6 +44,9 @@ SRCS = wssshc.c wsssh.c wsscp.c
OBJS = $(SRCS:.c=.o) OBJS = $(SRCS:.c=.o)
TARGETS = wssshc wsssh wsscp TARGETS = wssshc wsssh wsscp
# Man pages
MANPAGES = man/wssshc.1 man/wsssh.1 man/wsscp.1
# Default target # Default target
all: $(TARGETS) all: $(TARGETS)
...@@ -69,12 +72,17 @@ clean: ...@@ -69,12 +72,17 @@ clean:
install: all install: all
install -d $(DESTDIR)/usr/local/bin install -d $(DESTDIR)/usr/local/bin
install -m 755 $(TARGETS) $(DESTDIR)/usr/local/bin/ install -m 755 $(TARGETS) $(DESTDIR)/usr/local/bin/
install -d $(DESTDIR)/usr/local/share/man/man1
install -m 644 $(MANPAGES) $(DESTDIR)/usr/local/share/man/man1/
# Uninstall (optional) # Uninstall (optional)
uninstall: uninstall:
rm -f $(DESTDIR)/usr/local/bin/wssshc rm -f $(DESTDIR)/usr/local/bin/wssshc
rm -f $(DESTDIR)/usr/local/bin/wsssh rm -f $(DESTDIR)/usr/local/bin/wsssh
rm -f $(DESTDIR)/usr/local/bin/wsscp rm -f $(DESTDIR)/usr/local/bin/wsscp
rm -f $(DESTDIR)/usr/local/share/man/man1/wssshc.1
rm -f $(DESTDIR)/usr/local/share/man/man1/wsssh.1
rm -f $(DESTDIR)/usr/local/share/man/man1/wsscp.1
.PHONY: all clean install uninstall .PHONY: all clean install uninstall
EOF EOF
......
...@@ -23,10 +23,14 @@ typedef struct { ...@@ -23,10 +23,14 @@ typedef struct {
void print_usage(const char *program_name) { void print_usage(const char *program_name) {
fprintf(stderr, "Usage: %s [options] [scp_options...] source destination\n", program_name); fprintf(stderr, "Usage: %s [options] [scp_options...] source destination\n", program_name);
fprintf(stderr, "WebSocket SCP Wrapper - SCP through WebSocket tunnels\n\n"); fprintf(stderr, "WebSocket SCP Wrapper - SCP through WebSocket tunnels\n\n");
fprintf(stderr, "Protect the dolls!\n\n");
fprintf(stderr, "Options:\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " --local-port PORT Local tunnel port (default: auto)\n"); fprintf(stderr, " --local-port PORT Local tunnel port (default: auto)\n");
fprintf(stderr, " --debug Enable debug output\n"); fprintf(stderr, " --debug Enable debug output\n");
fprintf(stderr, " --help Show this help\n"); fprintf(stderr, " --help Show this help\n");
fprintf(stderr, "\nDonations:\n");
fprintf(stderr, " BTC: bc1q3zlkpu95amtcltsk85y0eacyzzk29v68tgc5hx\n");
fprintf(stderr, " ETH: 0xdA6dAb526515b5cb556d20269207D43fcc760E51\n");
} }
int parse_args(int argc, char *argv[], wsscp_config_t *config) { int parse_args(int argc, char *argv[], wsscp_config_t *config) {
...@@ -307,6 +311,14 @@ int main(int argc, char *argv[]) { ...@@ -307,6 +311,14 @@ int main(int argc, char *argv[]) {
return 1; return 1;
} }
// Handle --help
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) {
print_usage(argv[0]);
return 0;
}
}
// Need at least two arguments (source and destination) // Need at least two arguments (source and destination)
if (optind + 1 >= argc) { if (optind + 1 >= argc) {
fprintf(stderr, "Error: Source and destination required\n"); fprintf(stderr, "Error: Source and destination required\n");
......
...@@ -23,10 +23,14 @@ typedef struct { ...@@ -23,10 +23,14 @@ typedef struct {
void print_usage(const char *program_name) { void print_usage(const char *program_name) {
fprintf(stderr, "Usage: %s [options] user@client.domain [ssh_options...]\n", program_name); fprintf(stderr, "Usage: %s [options] user@client.domain [ssh_options...]\n", program_name);
fprintf(stderr, "WebSocket SSH Wrapper - SSH through WebSocket tunnels\n\n"); fprintf(stderr, "WebSocket SSH Wrapper - SSH through WebSocket tunnels\n\n");
fprintf(stderr, "Protect the dolls!\n\n");
fprintf(stderr, "Options:\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " --local-port PORT Local tunnel port (default: auto)\n"); fprintf(stderr, " --local-port PORT Local tunnel port (default: auto)\n");
fprintf(stderr, " --debug Enable debug output\n"); fprintf(stderr, " --debug Enable debug output\n");
fprintf(stderr, " --help Show this help\n"); fprintf(stderr, " --help Show this help\n");
fprintf(stderr, "\nDonations:\n");
fprintf(stderr, " BTC: bc1q3zlkpu95amtcltsk85y0eacyzzk29v68tgc5hx\n");
fprintf(stderr, " ETH: 0xdA6dAb526515b5cb556d20269207D43fcc760E51\n");
} }
int parse_args(int argc, char *argv[], wsssh_config_t *config) { int parse_args(int argc, char *argv[], wsssh_config_t *config) {
...@@ -307,6 +311,14 @@ int main(int argc, char *argv[]) { ...@@ -307,6 +311,14 @@ int main(int argc, char *argv[]) {
return 1; return 1;
} }
// Handle --help
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) {
print_usage(argv[0]);
return 0;
}
}
// Need at least one argument (the target) // Need at least one argument (the target)
if (optind >= argc) { if (optind >= argc) {
fprintf(stderr, "Error: No target specified\n"); fprintf(stderr, "Error: No target specified\n");
......
...@@ -25,6 +25,7 @@ typedef struct { ...@@ -25,6 +25,7 @@ typedef struct {
void print_usage(const char *program_name) { void print_usage(const char *program_name) {
fprintf(stderr, "Usage: %s [options]\n", program_name); fprintf(stderr, "Usage: %s [options]\n", program_name);
fprintf(stderr, "WebSocket SSH Client - Register with wssshd server\n\n"); fprintf(stderr, "WebSocket SSH Client - Register with wssshd server\n\n");
fprintf(stderr, "Protect the dolls!\n\n");
fprintf(stderr, "Options:\n"); fprintf(stderr, "Options:\n");
fprintf(stderr, " --server-ip IP Server IP address (required)\n"); fprintf(stderr, " --server-ip IP Server IP address (required)\n");
fprintf(stderr, " --port PORT Server port (default: %d)\n", DEFAULT_PORT); fprintf(stderr, " --port PORT Server port (default: %d)\n", DEFAULT_PORT);
...@@ -33,6 +34,9 @@ void print_usage(const char *program_name) { ...@@ -33,6 +34,9 @@ void print_usage(const char *program_name) {
fprintf(stderr, " --interval SEC Reconnection interval (default: 30)\n"); fprintf(stderr, " --interval SEC Reconnection interval (default: 30)\n");
fprintf(stderr, " --debug Enable debug output\n"); fprintf(stderr, " --debug Enable debug output\n");
fprintf(stderr, " --help Show this help\n"); fprintf(stderr, " --help Show this help\n");
fprintf(stderr, "\nDonations:\n");
fprintf(stderr, " BTC: bc1q3zlkpu95amtcltsk85y0eacyzzk29v68tgc5hx\n");
fprintf(stderr, " ETH: 0xdA6dAb526515b5cb556d20269207D43fcc760E51\n");
} }
int parse_args(int argc, char *argv[], wssshc_config_t *config) { int parse_args(int argc, char *argv[], wssshc_config_t *config) {
...@@ -75,6 +79,14 @@ int parse_args(int argc, char *argv[], wssshc_config_t *config) { ...@@ -75,6 +79,14 @@ int parse_args(int argc, char *argv[], wssshc_config_t *config) {
} }
} }
// Handle --help
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) {
print_usage(argv[0]);
return 0;
}
}
// Validate required arguments // Validate required arguments
if (!config->server_ip || !config->client_id || !config->password) { if (!config->server_ip || !config->client_id || !config->password) {
fprintf(stderr, "Error: --server-ip, --id, and --password are required\n"); fprintf(stderr, "Error: --server-ip, --id, and --password are required\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment