require 'formula' def use_default_names? ARGV.include? '--default-names' end def coreutils_aliases s = "brew_prefix=`brew --prefix`\n" %w{ base64 basename cat chcon chgrp chmod chown chroot cksum comm cp csplit cut date dd df dir dircolors dirname du echo env expand expr factor false fmt fold gropus head hostid id install join kill link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir runcon seq sha1sum sha225sum sha256sum sha384sum sha512sum shred shuf sleep sort split stat stty sum sync tac tail tee test touch tr true tsort tty uname unexpand uniq unlink uptime users vdir wc who whoami yes }.each do |g| s += "alias #{g}=\"$brew_prefix/bin/g#{g}\"\n" end s += "alias '['=\"$brew_prefix/bin/g[\"\n" return s end class Coreutils