Commit Graph

14 Commits (720a01140c0f93088b7d25172b3173e76b820bab)

Author SHA1 Message Date
Aadhavan Srinivasan 40858a673a Use my regex engine instead of the stdlib one
Aadhavan Srinivasan 9fce9cf2a1 Construct config path using user's home directory, instead of trying to guess what the home directory is
Aadhavan Srinivasan d15a771e89 Removed references to Windows support
The program doesn't seem to work on Windows, and I don't have the time
right now to debug it. So, at the moment, the program isn't supported on Windows.
Aadhavan Srinivasan b65cef96c3 Replaced the relative path on Windows with an absolute path
Aadhavan Srinivasan eb2a0a9122 If the color config file exists, load colors from it
Aadhavan Srinivasan 624ea575cc Changed behavior of program when 'disable color' flag is passed.
Instead of printing out the contents early on (which wouldn't allow it to work
with '-n'), I skip the loop that applies colors based on the regular expressions.
Aadhavan Srinivasan ffae02b62b Fixed bug where line number wasn't updated
Aadhavan Srinivasan 81b976bcc7 Added 'line number' flag, and added check for empty file.
I added a 'line number' flag ('-n') which will print the line number
with padding before every line. To ensure that a line number isn't printed when
trying to 'ccat' an empty file, I added a check to see if the file is empty.
If it is, the program exits.
Aadhavan Srinivasan 0b67cb317e Added 'disable color' flag ('-d') to disable color printing. Also replaced os.Args with flag.Args, to retrieve command-line arguments after stripping out flags
Aadhavan Srinivasan 098f7fe01b Instead of using command-line flags, I decided to generate the configs if they don't exist
Aadhavan Srinivasan 94d1d99af2 Added a flag called 'generate-config' which will generate default config files.
Aadhavan Srinivasan 7feac0b5f7 Renamed 'printAndExit' to 'printErrAndExit'
Aadhavan Srinivasan 2a007ba56c Replaced 'panic' with an error return, and a call to 'printAndExit'
Aadhavan Srinivasan 025ec775ca First commit