当前位置: 首页>>代码示例>>C#>>正文


C# CLI.CmdParserOptionSet类代码示例

本文整理汇总了C#中GitSharp.CLI.CmdParserOptionSet的典型用法代码示例。如果您正苦于以下问题:C# CmdParserOptionSet类的具体用法?C# CmdParserOptionSet怎么用?C# CmdParserOptionSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CmdParserOptionSet类属于GitSharp.CLI命名空间,在下文中一共展示了CmdParserOptionSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Run

        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()},
               { "p=", "Each '-p' indicates the id of a parent commit object", v => cmd.P = 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);
            }
        }
开发者ID:deodelacruz,项目名称:GitSharp,代码行数:26,代码来源:CommitTree.cs

示例2: Run

        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()},
               { "o=", "Directory in which to place the individual messages", v => cmd.O = v },
               { "b", "If any file doesn't begin with a From line, assume it is a single mail message instead of signaling error", v => cmd.B = true },
               { "d=", "Instead of the default 4 digits with leading zeros, different precision can be specified for the generated filenames", v => cmd.D = v },
               { "f=", "Skip the first <nn> numbers, for example if -f3 is specified, start the numbering with 0004", v => cmd.F = 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);
            }
        }
开发者ID:deodelacruz,项目名称:GitSharp,代码行数:29,代码来源:Mailsplit.cs

示例3: Run

        public override void Run(string[] args)
        {
            cmd.Quiet = false;

            options = new CmdParserOptionSet()
            {
               { "h|help", "Display this help information. To see online help, use: git help <command>", v=>OfflineHelp()},
               { "q|quiet", "Do not issue an error message if the <name> is not a symbolic ref but a detached HEAD; instead exit with non-zero status silently", v => cmd.Quiet = true },
               { "m=", "Update the reflog for <name> with <reason>", v => cmd.M = 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);
            }
        }
开发者ID:spraints,项目名称:GitSharp,代码行数:29,代码来源:SymbolicRef.cs

示例4: Run

        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()},
               { "shared=", "Only used with the 'init' command", v => cmd.Shared = v },
               { "template=", "Only used with the 'init' command", v => cmd.Template = v },
               { "r|revision=", "Used with the 'fetch' command", v => cmd.Revision = v },
               { ":|stdin", "Only used with the 'set-tree' command", v => cmd.Stdin = true },
               { "rmdir", "Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands", v => cmd.Rmdir = true },
               { "e|edit", "Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands", v => cmd.Edit = true },
               { "l|find-copies-harder=", "Only used with the 'dcommit', 'set-tree' and 'commit-diff' commands", v => cmd.FindCopiesHarder = v },
               { "A|authors-file=", "", v => cmd.AuthorsFile = 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);
            }
        }
开发者ID:deodelacruz,项目名称:GitSharp,代码行数:33,代码来源:Svn.cs

示例5: Run

        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()},
               { "format=", "Format of the resulting archive: 'tar' or 'zip'", v => cmd.Format = v },
               { "l|list", "Show all available formats", v => cmd.List = true },
               { "v|verbose", "Report progress to stderr", v => cmd.Verbose = true },
               { "prefix=", "Prepend <prefix>/ to each filename in the archive", v => cmd.Prefix = v },
               { "o|output=", "Write the archive to <file> instead of stdout", v => cmd.Output = v },
               { "worktree-attributes", "Look for attributes in", v => cmd.WorktreeAttributes = true },
               { "remote=", "Instead of making a tar archive from the local repository, retrieve a tar archive from a remote repository", v => cmd.Remote = v },
               { "exec=", "Used with --remote to specify the path to the 'git-upload-archive' on the remote side", v => cmd.Exec = 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);
            }
        }
开发者ID:spraints,项目名称:GitSharp,代码行数:33,代码来源:Archive.cs

示例6: Run

        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()},
               { "v", "Be verbose about what is going on, including progress status", v => cmd.V = true },
               { "o=", "Write the generated pack index into the specified file", v => cmd.O = v },
               { "stdin", "When this flag is provided, the pack is read from stdin instead and a copy is then written to <pack-file>", v => cmd.Stdin = true },
               { "fix-thin", "It is possible for 'git-pack-objects' to build \"thin\" pack, which records objects in deltified form based on objects not included in the pack to reduce network traffic", v => cmd.FixThin = true },
               // [Mr Happy] I have no idea how OptionSet handles the two lines below this one.
               //            might or might not work, haven't tested yet.
               { "keep", "Before moving the index into its final destination create an empty", v => cmd.Keep = true },
               { "keep=", "Like --keep create a", v => cmd.KeepMsg = v },
               { "index-version=", "This is intended to be used by the test suite only", v => cmd.IndexVersion = v },
               { "strict", "Die, if the pack contains broken objects or links", v => cmd.Strict = true },
            };

            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);
            }
        }
开发者ID:dev218,项目名称:GitSharp,代码行数:35,代码来源:IndexPack.cs

示例7: Run

        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()},
               { "receive-pack=", "Path to the 'git-receive-pack' program on the remote end", v => cmd.ReceivePack = v },
               { "exec=", "Same as --receive-pack=<git-receive-pack>", v => cmd.Exec = v },
               { "all", "Instead of explicitly specifying which refs to update, update all heads that locally exist", v => cmd.All = true },
               { "dry-run", "Do everything except actually send the updates", v => cmd.DryRun = true },
               { "force", "Usually, the command refuses to update a remote ref that is not an ancestor of the local ref used to overwrite it", v => cmd.Force = true },
               { "verbose", "Run verbosely", v => cmd.Verbose = true },
               { "thin", "Spend extra cycles to minimize the number of objects to be sent", v => cmd.Thin = true },
            };

            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);
            }
        }
开发者ID:spraints,项目名称:GitSharp,代码行数:32,代码来源:SendPack.cs

示例8: Run

        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()},
               { "k", "Usually the program 'cleans up' the Subject: header line to extract the title line for the commit log message, among which (1) remove 'Re:' or 're:', (2) leading whitespaces, (3) '[' up to ']', typically '[PATCH]', and then prepends \"[PATCH] \"", v => cmd.K = true },
               { "b", "When -k is not in effect, all leading strings bracketed with '[' and ']' pairs are stripped", v => cmd.B = true },
               { "u", "The commit log message, author name and author email are taken from the e-mail, and after minimally decoding MIME transfer encoding, re-coded in UTF-8 by transliterating them", v => cmd.U = true },
               { "encoding=", "Similar to -u but if the local convention is different from what is specified by i18n", v => cmd.Encoding = v },
               { "n", "Disable all charset re-coding of the metadata", v => cmd.N = true },
               { "scissors", "Remove everything in body before a scissors line", v => cmd.Scissors = true },
               { "no-scissors", "Ignore scissors lines", v => cmd.NoScissors = true },
            };

            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);
            }
        }
开发者ID:deodelacruz,项目名称:GitSharp,代码行数:32,代码来源:Mailinfo.cs

示例9: Run

        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()},
               { "log", "In addition to branch names, populate the log message with one-line descriptions from the actual commits that are being merged", v => cmd.Log = true },
               { "no-log", "Do not list one-line descriptions from the actual commits being merged", v => cmd.Log = false },
					// [obsolete]
               //{ "summary", "Synonyms to --log and --no-log; these are deprecated and will be removed in the future", v => cmd.Summary = true },
               //{ "no-summary", "Synonyms to --log and --no-log; these are deprecated and will be removed in the future", v => cmd.NoSummary = true },
               { "F|file=", "Take the list of merged objects from <file> instead of stdin", v =>
               	{
               		//cmd.File = 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);
            }
        }
开发者ID:dev218,项目名称:GitSharp,代码行数:35,代码来源:FmtMergeMsg.cs

示例10: Run

        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()},
               { "f", "If an existing replace ref for the same object exists, it will be overwritten (instead of failing)", v => cmd.F = true },
               { "d", "Delete existing replace refs for the given objects", v => cmd.D = true },
               { "l=", "List replace refs for objects that match the given pattern (or all if no pattern is given)", v => cmd.L = 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);
            }
        }
开发者ID:spraints,项目名称:GitSharp,代码行数:28,代码来源:Replace.cs

示例11: Run

        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()},
               { "all", "Processes all packs", v => cmd.All = true },
               { "alt-odb", "Don't require objects present in packs from alternate object directories to be present in local packs", v => cmd.AltOdb = true },
               { "verbose", "Outputs some statistics to stderr", v => cmd.Verbose = true },
            };

            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);
            }
        }
开发者ID:dev218,项目名称:GitSharp,代码行数:28,代码来源:PackRedundant.cs

示例12: Run

        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()},
               { "a|all", "Output all merge bases for the commits, instead of just one", v => cmd.All = true },
            };

            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);
            }
        }
开发者ID:dev218,项目名称:GitSharp,代码行数:26,代码来源:MergeBase.cs

示例13: Run

        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()},
               { "m=", "Use the given note message (instead of prompting)", v => cmd.M = v },
               { "F=", "Take the note message from the given file", v => cmd.F = 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);
            }
        }
开发者ID:spraints,项目名称:GitSharp,代码行数:27,代码来源:Notes.cs

示例14: Run

        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()},
            #if ported
                { "n|dry-run", "Dry run", v=> {isDryRun = true;}},
                { "f|force", "Override the up-to-date check", v=>{isForced = true;}},
                { "q|quiet", "Be quiet", v=>{isQuiet = true;}},
                { "cached", "Only remove from the index", v=>{isCached = true;}},
                { "r", "Allow recursive removal", v=>{allowRecursiveRemoval = true;}},
                { "ignore-match", "Exit with a zero status even if nothing is matched", v=>{ignoreUnmatch = true;}},
            #endif
            };

            try
            {
                List<String> arguments = ParseOptions(args);
                if (arguments.Count > 0)
                {
                    DoRm(arguments);
                }
                else
                {
                    OfflineHelp();
                }
            } catch (OptionException e) {
                Console.WriteLine(e.Message);
            }
        }
开发者ID:spraints,项目名称:GitSharp,代码行数:30,代码来源:Rm.cs

示例15: Run

        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()},
               { "L=", "This option may be given up to three times, and specifies labels to be used in place of the corresponding file names in conflict reports", v => cmd.L = v },
               { "p", "Send results to standard output instead of overwriting `<current-file>`", v => cmd.P = true },
               { "q", "Quiet; do not warn about conflicts", v => cmd.Q = true },
            };

            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);
            }
        }
开发者ID:spraints,项目名称:GitSharp,代码行数:28,代码来源:MergeFile.cs


注:本文中的GitSharp.CLI.CmdParserOptionSet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。