diff --git a/qdls/Program.cs b/qdls/Program.cs index 6c1aa17..5f60b61 100644 --- a/qdls/Program.cs +++ b/qdls/Program.cs @@ -12,10 +12,14 @@ if(arguments.Count == 0) // run on targets foreach(var arg in arguments) { // don't try to list nonexistent entries or files - if(!Path.Exists(arg)) - Console.WriteLine($"'{arg}: does not exist"); - if(File.Exists(arg)) - Console.WriteLine($"'{arg}: is file"); + if(!Path.Exists(arg)) { + Console.WriteLine($"'{arg}': does not exist"); + continue; + } + if(File.Exists(arg)) { + Console.WriteLine($"'{arg}': is file"); + continue; + } // fetch children var children = Directory.GetFileSystemEntries(arg); @@ -33,7 +37,7 @@ foreach(var arg in arguments) { if(args.Length > 1) Console.WriteLine($"{arg}:"); // iterate over children; build buffer and output when full - foreach(var child in children) { + foreach(var child in children.OrderBy(f => (int)(Path.GetFileName(f)[0]))) { var name = Path.GetFileName(child); // format hidden files