winure/qdls/Util.cs

30 lines
685 B
C#
Raw Normal View History

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;
}
2024-06-10 09:53:43 -04:00
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
}