diff --git a/yahb/CopyModule.cs b/yahb/CopyModule.cs index 621f198..b338a79 100644 --- a/yahb/CopyModule.cs +++ b/yahb/CopyModule.cs @@ -53,6 +53,17 @@ public List createDirectoryList() { dir_stack.Push(cfg.sourceDirectory); } + // add directories from file here to stack + // /s is used, in order to get all + // subdirs + if(cfg.copySubDirectories) + { + foreach( string dir_i in cfg.inputDirectories) + { + dir_stack.Push(dir_i); + } + } + List subdirs; while (dir_stack.Count > 0) { @@ -110,7 +121,12 @@ public List createDirectoryList() { dirs.Add(cfg.sourceDirectory); } // get directories from provided input file - dirs.AddRange(cfg.inputDirectories); + // but only if /s was not provided (otherwise) + // above stack operation added them incl. subdirs + if (!cfg.copySubDirectories) + { + dirs.AddRange(cfg.inputDirectories); + } // filter directories according to input given List dirs_filtered = new List(); diff --git a/yahb/ParseCmdLine.cs b/yahb/ParseCmdLine.cs index d1d7c8a..9f73b22 100644 --- a/yahb/ParseCmdLine.cs +++ b/yahb/ParseCmdLine.cs @@ -202,9 +202,9 @@ public void DisplayVerboseHelp() Console.WriteLine(" If this options is used, can be"); Console.WriteLine(" omitted. If both and /id:FILENAME"); Console.WriteLine(" are present, all directories will be copied."); - Console.WriteLine(" NOTE that if /s is provided, it will NOT be "); - Console.WriteLine(" applied to the list of input directories, but"); - Console.WriteLine(" will be applied to ."); + Console.WriteLine(" NOTE that if /s is provided, it will be "); + Console.WriteLine(" applied to the list of input directories, and"); + Console.WriteLine(" will also be applied to ."); Console.WriteLine(""); Console.WriteLine(" /list :: do not copy anything, just list all files"); Console.WriteLine("");