예제 #1
0
 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));
         }
     }
 }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }