This removes the output of bee generate in watch.go as it shows
the entire logger output (including the banner). Added also the ability
to catch the exec.Command error instead of returning the exit status.
Added ability to display the default value of a command's flag,
truncated in case it contains a column (:). Also instead of displaying
the entire command usage/help in case of an undefined flag, output a
small message with "bee help cmd".
This uses the template/text instead because template/html does not escape
quotes and replaces them with their HTML codes. Added two more util
functions to make it easy to use bold and colored text in the command long
description.
Now each command has its own output destination, which can be changed
using a SetOutput(writer) method. Added ability to display the options
of each command.
Now each command has a PreRun function that will execute before calling
the Run() function. This allows to show the banner and do some pre-check
work. Also moved parsePackagesFromDir() to the main function to avoid
getting called each time 'bee' is invoked.
The function parsePackagesFromDir() was panicing when it encounter some
"invalid" Go files. Instead, this will allow it to display a warning and
continue the execution of the command.
Moved logging to the new logging infrastructure by removing the use of
ColorLog() function. Added more documentation. Also fixed some typos in
comments and function names.
logger.go implements the logging infrastructure for Bee.
The end user can set the preferred backend (that implements io.Writer).
It supports multiple logging levels, and logs are sent to the output
colored based on each level. Debug logs are treated differently, i.e.
they will be sent to the output unless DEBUG_ENABLED is set to "1".
Rewrited loadConfig() function to walk the project directory
looking for bee.json and Beefile. If no configuration file
found, it fallbacks to the default configuration. In case
of an error, a log message is printed to the console.