winure/qdls/Util.cs

29 lines
685 B
C#

namespace Qdls;
using System.IO;
public static class Util {
public static bool IsHidden(string path) {
var name = Path.GetFileName(path);
return
name.StartsWith('.') ||
( File.GetAttributes(path) & FileAttributes.Hidden ) == FileAttributes.Hidden;
}
public static bool CheckFlag(List<String> args, params string[] forms) {
var found = args.RemoveAll(forms.Contains);
return found > 0;
}
}
public static class Format {
public const string Reset = "\x1b[0m"; // reset
public const string Hidden = "\x1b[2;3m"; // faint + italic
public const string Executable = "\x1b[1;32m"; // bold + green
public const string Directory = "\x1b[1;34m"; // bold + blue
}