From b586afd8739c6b340c76775eac47d94fc4a77338 Mon Sep 17 00:00:00 2001 From: Mikhail Gerasimchuk Date: Sat, 18 Nov 2023 20:04:50 +0700 Subject: [PATCH] Add ascii logo for help command --- README.md | 4 ++-- internal/adapter/cli/root.go | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 54d09d1..d04cf5c 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ These capabilities make Protty a useful tool for a variety of purposes, such as The following command will start a proxy on port 8080, and after starting, all traffic from port 8080 will be redirected to a remote host located at https://example.com ```shell -docker run -p8080:80 -e REMOTE_URI=https://example.com:443 mgerasimchuk/protty:v0.4.5 +docker run -p8080:80 -e REMOTE_URI=https://example.com:443 mgerasimchuk/protty:v0.4.6 ``` ## Supported Backends @@ -39,7 +39,7 @@ docker run -p8080:80 -e REMOTE_URI=https://example.com:443 mgerasimchuk/protty:v ## Running options and runtime configuration ``` -» ~ docker run -p8080:80 -it mgerasimchuk/protty:v0.4.5 /bin/sh -c 'protty start --help' +» ~ docker run -p8080:80 -it mgerasimchuk/protty:v0.4.6 /bin/sh -c 'protty start --help' Start the proxy Usage: diff --git a/internal/adapter/cli/root.go b/internal/adapter/cli/root.go index 79cafa4..54f2750 100644 --- a/internal/adapter/cli/root.go +++ b/internal/adapter/cli/root.go @@ -8,12 +8,24 @@ type RootCommand struct { cobraCmd *cobra.Command } +const asciiLogo = ` + ################### + ####################### + ######################### ____ ____ ___ _____ _____ __ __ + ####### ### ####### | _ \ | _ \ / _ \ |_ _| |_ _| \ \ / / + ####### ###### ####### | |_) | | |_) | | | | | | | | | \ V / + ####### ####### ####### | __/ | _ < | |_| | | | | | | | + ####### ###### ####### |_| |_| \_\ \___/ |_| |_| |_| + ####### ### ####### + ##### ##### +` + func NewRootCommand() *RootCommand { rootCommand := &RootCommand{} rootCommand.cobraCmd = &cobra.Command{ Use: "protty", - Short: "Protty is a HTTP proxy written in Go that redirects requests to a remote host", + Short: asciiLogo + "\n" + "HTTP proxy interceptor with on the fly request/response transforming capabilities", } rootCommand.cobraCmd.CompletionOptions.HiddenDefaultCmd = true