private static void InsertRemoveFilesParameters(RemoveFilesParameters parameters, IList<ICommandArgument> args) { if(parameters.Force) { args.Add(RmCommand.Force()); } if(parameters.Recursive) { args.Add(RmCommand.Recursive()); } if(parameters.Cached) { args.Add(RmCommand.Cached()); } if(parameters.IgnoreUnmatch) { args.Add(RmCommand.IgnoreUnmatch()); } if(parameters.Paths != null && parameters.Paths.Count != 0) { args.Add(RmCommand.NoMoreOptions()); foreach(var path in parameters.Paths) { args.Add(new PathCommandArgument(path)); } } }
public Command GetQueryFilesToRemoveCommand(RemoveFilesParameters parameters) { Assert.IsNotNull(parameters); var args = new List<ICommandArgument>((parameters.Paths != null ? parameters.Paths.Count + 1 : 0) + 5); args.Add(RmCommand.DryRun()); InsertRemoveFilesParameters(parameters, args); return new RmCommand(args); }
public Command GetRemoveFilesCommand(RemoveFilesParameters parameters) { Assert.IsNotNull(parameters); var args = new List<ICommandArgument>((parameters.Paths != null ? parameters.Paths.Count + 1 : 0) + 4); InsertRemoveFilesParameters(parameters, args); return new RmCommand(args); }