better hidden file handling
This commit is contained in:
parent
cf7c78569c
commit
6f61a98ebc
1 changed files with 4 additions and 7 deletions
|
@ -1,5 +1,4 @@
|
|||
using System.IO;
|
||||
|
||||
|
||||
using Qdls;
|
||||
|
||||
// collect args; no args becomes working directory
|
||||
|
@ -10,7 +9,7 @@ else
|
|||
arguments = args;
|
||||
|
||||
// flags
|
||||
bool showHidden = true;
|
||||
bool showHidden = false;
|
||||
|
||||
// run on targets
|
||||
foreach(var arg in arguments) {
|
||||
|
@ -22,6 +21,7 @@ foreach(var arg in arguments) {
|
|||
|
||||
// fetch children
|
||||
var children = Directory.GetFileSystemEntries(arg);
|
||||
if(!showHidden) { children = children.Where(f => !Util.IsHidden(f)).ToArray(); }
|
||||
|
||||
// state vars
|
||||
var buffer = "";
|
||||
|
@ -39,10 +39,7 @@ foreach(var arg in arguments) {
|
|||
|
||||
// skip or format hidden files
|
||||
if(Util.IsHidden(child))
|
||||
if(showHidden)
|
||||
buffer += Format.Hidden;
|
||||
else
|
||||
continue;
|
||||
buffer += Format.Hidden;
|
||||
|
||||
// format directories
|
||||
if(Directory.Exists(child))
|
||||
|
|
Loading…
Reference in a new issue