[BusyBox] re: long args in bb_getopt_ulflags()

Paul Fox pgf at brightstareng.com
Wed Feb 2 15:30:23 UTC 2005


 > The goal should be to make the code smaller:
 > [*] ls                                                               
 >    [*]     Enable filetyping options (-p and -F)
 >    [*]     Enable symlinks dereferencing (-L)
 >    [*]     Enable recursion (-R)
 >    [*]     Sort the file names    
 >    [*]     Show file timestamps  
 >    [*]     Show username/groupnames 
 >    [*]     Use color to identify file types   <- This turns on color by default with no way to turn it off
 >       [*]  Use color only if --color is specified on the command line
 > 
 > In this case we could just check for --color with no args and ignore LS_COLORS variable
 > at all as the colors are hardcoded.
 > It would be easy to turn color off/on depending on the devices and screens we are using.
 > The downside is that maybe this is not standard compliant.

with my patch, the config tree looks like:
    ....
  [*]  Show username/groupnames
  [*]  Allow use of color to identify file types <-- "--color" controls color
  [*]    Produce colored ls output by default    <-- changes default from
                                                        "off" to auto

so you're rearranging the features to change the default behavior, and
maybe make the code a tiny bit smaller?  in my mind, the whole point
of the patch was to get away from "color is always on by default
most of the time in most builds, with no way to turn it off"
which is what we have now.  i don't think your arrangement fixes this.
mine does, and, as you say, in a GNU-ls-compliant way.

as for code size?  i can't imagine why anyone concerned with code
size would turn ls coloring on in the first case.  i don't.  i'm just
trying to make things livable when i use a busybox someone else has
built.

paul
=---------------------
 paul fox, pgf at brightstareng.com



More information about the busybox mailing list