Execute() public method

public Execute ( Context, context ) : void
context Context,
return void
Esempio n. 1
0
        public override void Run(string[] args)
        {
            options = new CmdParserOptionSet()
            {
                { "h|help", "Display this help information. To see online help, use: git help <command>", v => OfflineHelp() },
                { "stat", "Instead of applying the patch, output diffstat for the input", v => cmd.Stat = true },
                { "numstat", "Similar to `--stat`, but shows the number of added and deleted lines in decimal notation and the pathname without abbreviation, to make it more machine friendly", v => cmd.Numstat = true },
                { "summary", "Instead of applying the patch, output a condensed summary of information obtained from git diff extended headers, such as creations, renames and mode changes", v => cmd.Summary = true },
                { "check", "Instead of applying the patch, see if the patch is applicable to the current working tree and/or the index file and detects errors", v => cmd.Check = true },
                { "index", "When `--check` is in effect, or when applying the patch (which is the default when none of the options that disables it is in effect), make sure the patch is applicable to what the current index file records", v => cmd.Index = true },
                { "cached", "Apply a patch without touching the working tree", v => cmd.Cached = true },
                { "build-fake-ancestor=", "Newer 'git-diff' output has embedded 'index information' for each blob to help identify the original version that the patch applies to", v => cmd.BuildFakeAncestor = v },
                { "R|reverse", "Apply the patch in reverse", v => cmd.Reverse = true },
                { "reject", "For atomicity, 'git-apply' by default fails the whole patch and does not touch the working tree when some of the hunks do not apply", v => cmd.Reject = true },
                { "z", "When `--numstat` has been given, do not munge pathnames, but use a NUL-terminated machine-readable format", v => cmd.Z = true },
                { "p=", "Remove <n> leading slashes from traditional diff paths", v => cmd.P = v },
                { "C=", "Ensure at least <n> lines of surrounding context match before and after each change", v => cmd.C = v },
                { "unidiff-zero", "By default, 'git-apply' expects that the patch being applied is a unified diff with at least one line of context", v => cmd.UnidiffZero = true },
                { "apply", "If you use any of the options marked \"Turns off 'apply'\" above, 'git-apply' reads and outputs the requested information without actually applying the patch", v => cmd.Apply = true },
                { "no-add", "When applying a patch, ignore additions made by the patch", v => cmd.NoAdd = true },
                { "allow-binary-replacement", "Historically we did not allow binary patch applied without an explicit permission from the user, and this flag was the way to do so", v => cmd.AllowBinaryReplacement = true },
                { "binary", "Historically we did not allow binary patch applied without an explicit permission from the user, and this flag was the way to do so", v => cmd.Binary = true },
                { "exclude=", "Don't apply changes to files matching the given path pattern", v => cmd.Exclude = v },
                { "include=", "Apply changes to files matching the given path pattern", v => cmd.Include = v },
                { "ignore-space-change", "When applying a patch, ignore changes in whitespace in context lines if necessary", v => cmd.IgnoreSpaceChange = true },
                { "ignore-whitespace", "When applying a patch, ignore changes in whitespace in context lines if necessary", v => cmd.IgnoreWhitespace = true },
                { "whitespace=", "When applying a patch, detect a new or modified line that has whitespace errors", v => cmd.Whitespace = v },
            };

            try
            {
                List <String> arguments = ParseOptions(args);
                if (arguments.Count > 0)
                {
                    cmd.Arguments = arguments;
                    cmd.Execute();
                }
                else
                {
                    OfflineHelp();
                }
            }
            catch (Exception e)
            {
                cmd.OutputStream.WriteLine(e.Message);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Method will execute when OkCommand executed
 /// </summary>
 private void OkCommandExecute(object obj)
 {
     ApplyCommand.Execute(null);
     DiagramBuilderVM.OpenCloseWindowBehavior.OpenDiagramStyleWindow = false;
 }
Esempio n. 3
0
 public void Execute_MultiplyIsCalledWithNumberThree()
 {
     _command.Execute();
     _mockCalculator.Verify(calculator => calculator.Apply(It.Is <int>(i => i == _numberToApply)));
 }
 /// <summary>
 /// Method will execute when OkCommand executed
 /// </summary>
 private void OkCommandExecute(object obj)
 {
     ApplyCommand.Execute(null);
     MindMapViewModel.OpenCloseWindowBehavior.OpenDiagramStyleWindow = false;
 }