Last active
August 8, 2023 03:13
-
-
Save naranyala/b86c75e3310a74c22bcb4c196edec883 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ENHANCED MAN (github.com/naranyala) | |
########################## | |
# combining: man and bat # | |
########################## | |
# Check if the command is provided as the first command-line argument | |
if [[ -n "$1" ]]; then | |
command="$1" | |
else | |
# Prompt the user for the command | |
read -p "Enter the command: " command | |
fi | |
# Validate if the command is provided | |
if [[ -z "$command" ]]; then | |
echo "Please provide a command." | |
exit 1 | |
fi | |
# Execute the `man` command and pipe the output to `bat` for colorizing | |
man "$command" | bat --language=man |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment