Forwarding upstream from https://bugs.maemo.org/show_bug.cgi?id=3957 . VERSION: 1.10.3 STEPS TO REPRODUCE: In Busybox, enter ls -Q EXPECTED OUTCOME: quoted list of files. GNU "ls -Q" encloses filenames in double quotes. ACTUAL OUTCOME: ls: invalid option -- Q and the list of valid options REPRODUCIBILITY: always OTHER COMMENTS: -Q is not a posix standard option, but is quite popular and useful. Many debian pre/post inst/rm scripts use this for things in /etc/init.d. Other examples where this is an issue: https://bugs.maemo.org/show_bug.cgi?id=3951#c6 https://bugs.maemo.org/show_bug.cgi?id=3948#c2
Created attachment 87 [details] Patch to implement -Q and -g
Fixed in revision 25505, thanks!
Created attachment 1345 [details] adjust column width for multi-column ls -Q output A minor (I assume most consumers of ls -Q would be running it in single-column mode) issue is that in multi-column mode the column width isn't adjusted to include the quotes. The attached patch is against 1.16.0.
I don't see why it is needed. Without patch it already looks correct: # ./busybox ls AUTHORS busybox_ldscript libbb Config.in busybox_ldscript_nobss libpwdgrp ... busybox init util-linux # ./busybox ls -Q "AUTHORS" "busybox_ldscript" "libbb" "Config.in" "busybox_ldscript_nobss" "libpwdgrp" ... With -Q, columns become 2 chars wider. Right?