add a command to write package and cask dependency tree

This commit is contained in:
dchakro 2024-08-12 11:24:48 -07:00
parent 8ca6f92e26
commit c3374a27be

View file

@ -26,6 +26,7 @@ OPTIONS:
--help Show help --help Show help
--brew-help Show brew commands (alias to "brew help") --brew-help Show brew commands (alias to "brew help")
version Show brewlog version info version Show brewlog version info
tree Write the dependency tree of all installed packages & casks to a file
archive Archives the current log file as .xz (gzip as fallback if xz not found) archive Archives the current log file as .xz (gzip as fallback if xz not found)
find [TERM] grep the TERM in the logfile. find [TERM] grep the TERM in the logfile.
tail [-n INT] Show the last "INT" lines from the log file. tail [-n INT] Show the last "INT" lines from the log file.
@ -75,6 +76,10 @@ elif [ "$1" == "--brew-help" ]; then
elif [ "$1" == "version" ]; then elif [ "$1" == "version" ]; then
VERSION VERSION
exit 0; exit 0;
elif [ "$1" == "tree" ]; then
brew deps --tree --installed >> $HOME/Logs/brew_tree.txt
echo "package and cask dependency tree updated. Find it here: ~/Logs/brew_tree.txt"
exit 0;
elif [ "$1" == "tail" ]; then elif [ "$1" == "tail" ]; then
if [ "$2" == "-n" ]; then if [ "$2" == "-n" ]; then
# tail with specified number of lines # tail with specified number of lines