Let's Rewrite Linux 'ls' command: Processing flags
In this article we will start processing some flags of ls command.
If you want to know more about command, please read Part 1.
If you want to know how we configured tests, check Part 2.
If you want to know how we collected info about files, check Part 3.
Note: Source codes can be found at: https://github.com/Miradils-Blog/linux-ls
Introduction In previous part we collected all necessary info of all files and printed them out. However, we used them only for printing, nothing else. For some flags, we don’t even need the info of certain files (by default, we do not need info of hidden files, or in case of -A we do not need data of current (.) and previous (..) directory, etc.). So, we need to process the flags to know which files we need to collect data of, and how to print the needed output. So, let’s start with flags, which affect our printing style.