Skip to content

Commit

Permalink
Add ascii logo for the help command
Browse files Browse the repository at this point in the history
  • Loading branch information
mgerasimchuk committed Nov 18, 2023
1 parent 1b3b041 commit 88cbd6c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
14 changes: 13 additions & 1 deletion internal/adapter/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 88cbd6c

Please sign in to comment.