This is a simple command-line tool written in Go. It takes a string input entered by the user then returns its graphical representation using the ASCII art characters from the specified banner file.
-
Clone Repository: Clone this repository to your local machine.
-
Install go: Ensure you have Go installed on your machine.
-
Run Program: Execute the program by providing the flag, input string, and banner file as command-line arguments.
go run . --output=<filename.txt> something standard
Example :
go run . --output=<output.txt> hello standard
This will return the graphical representation of the input string "hello". The results will be written to the specified output.txt file.
cat -e output.txt
_ _ _ | | | | | | | |__ ___ | | | | ___ | _ \ / _ \ | | | | / _ \ | | | | | __/ | | | | | (_) | |_| |_| \___| |_| |_| \___/
Additionally, the program can run with a single string argument even when the user doesn't specify the flag.
go run . hello
_ _ _
| | | | | |
| |__ ___ | | | | ___
| _ \ / _ \ | | | | / _ \
| | | | | __/ | | | | | (_) |
|_| |_| \___| |_| |_| \___/
In this case, the result will be written to the default output file then automatically displayed on the terminal.
The main_test.go file tests the whole program while ascii_art_test.go tests the functions. To be able to run the main_test.go file successfully you have to first run the main.go file, with "hello" as your input string and "output.txt" as the value for the flag. This will help generate the output file which will be checked by the main_test.go file.