From 52e8ddc035af05a38729112a1da9e64ddb827413 Mon Sep 17 00:00:00 2001 From: Jordan Wallwork Date: Tue, 28 Jan 2014 23:11:45 +0000 Subject: [PATCH 1/2] Make category inherit Drop (so it can be used in templates) --- src/Pretzel.Logic/Templating/Context/Category.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Pretzel.Logic/Templating/Context/Category.cs b/src/Pretzel.Logic/Templating/Context/Category.cs index c466b0870..cbca90e56 100644 --- a/src/Pretzel.Logic/Templating/Context/Category.cs +++ b/src/Pretzel.Logic/Templating/Context/Category.cs @@ -1,8 +1,9 @@ using System.Collections.Generic; +using DotLiquid; namespace Pretzel.Logic.Templating.Context { - public class Category + public class Category : Drop { public IEnumerable Posts { get; set; } public string Name { get; set; } From 8fe1e6c81b6808ee3bc9b81a2a855dddd9fe3c4a Mon Sep 17 00:00:00 2001 From: Jordan Wallwork Date: Mon, 24 Feb 2014 11:17:53 +0000 Subject: [PATCH 2/2] Add 'nopause' argument to prevent 'press any key to continue' message --- src/Pretzel/Program.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Pretzel/Program.cs b/src/Pretzel/Program.cs index 8318bfe2b..b51a89213 100644 --- a/src/Pretzel/Program.cs +++ b/src/Pretzel/Program.cs @@ -24,10 +24,12 @@ static void Main(string[] args) var debug = false; var help = false; + var nopause = false; var defaultSet = new OptionSet { {"help", "Display help mode", p => help = true}, - {"debug", "Enable debugging", p => debug = true} + {"debug", "Enable debugging", p => debug = true}, + {"nopause", "Don't show \"Press any key to continue...\" message after execution", p => nopause = true} }; defaultSet.Parse(args); @@ -44,7 +46,7 @@ static void Main(string[] args) return; } - program.Run(args, defaultSet); + program.Run(args, defaultSet, nopause); } private void ShowHelp(OptionSet defaultSet) @@ -52,7 +54,7 @@ private void ShowHelp(OptionSet defaultSet) Commands.WriteHelp(defaultSet); } - private void Run(string[] args, OptionSet defaultSet) + private void Run(string[] args, OptionSet defaultSet, bool nopause) { var commandName = args[0]; var commandArgs = args.Skip(1).ToArray(); @@ -65,7 +67,7 @@ private void Run(string[] args, OptionSet defaultSet) } Commands[commandName].Execute(commandArgs); - WaitForClose(); + if (!nopause) WaitForClose(); } [Conditional("DEBUG")]