diff --git a/CLI/Program.cs b/CLI/Program.cs index e697404..8e0a815 100644 --- a/CLI/Program.cs +++ b/CLI/Program.cs @@ -39,7 +39,26 @@ class Program static int ListPasswords() { + DirectoryInfo d; + FileInfo[] files = new FileInfo[0]; + try + { + //since this file is already dependent on the Common namespace, we don't need events to mitigate this; better off asking ConfigFileManager for the path directly + d = new DirectoryInfo(ConfigFileManager.GetPath()); + files = d.GetFiles("*.gpg"); + } + catch (ArgumentNullException e) + { + ErrorOccured(e, "Error while getting password files"); + return 1; + } + foreach (FileInfo f in files) + { + Console.WriteLine($"\t{f.Name}"); + } + + return 0; } static void ErrorOccured(Exception e)