public void GetDirs(CmdParser parser) { var fullPath = parser.GetAttribute("name") ?? parser.GetAttribute(0); DirectoryStructure[] directoryStructures; if (fullPath.Substring(0, 1).Equals(":")) { var id = fullPath.TrimStart(':').ToInt(); directoryStructures = fileManager.GetDirectories(id); } else { directoryStructures = fileManager.GetDirectories(fullPath); } foreach (var dir in directoryStructures) { Console.WriteLine("{0}", dir); } }