Click here to Skip to main content
15,892,005 members
Articles / Desktop Programming / WPF

Zip My Code

Rate me:
Please Sign up or sign in to vote.
4.78/5 (17 votes)
20 Dec 2009CPOL3 min read 71.9K   2K   48  
A utility stripping your source code to the essential core and then compressing it to a nice CodeProject article attachment.
using Plossum.CommandLine;

namespace ZipMyCode.Cli
{
	/// <summary>
	/// Class configuring the options parsed by Plossum.
	/// </summary>
	[CommandLineManager(EnabledOptionStyles = OptionStyles.Windows)]
	[CommandLineOptionGroup("1_compress", Name = "Strip and compress", RequireExplicitAssignment = true)]
	[CommandLineOptionGroup("2_uninstall", Name = "Uninstallation")]
	[CommandLineOptionGroup("3_help", Name = "Help")]
	class PlossumOptions
	{
		#region Stip and compress

		/// <summary>
		/// Gets or sets the location and/or name of the compressed output file.
		/// </summary>
		[CommandLineOption(
			Name = "o",
			Aliases = "output",
			Description = "Specifies the name of the compressed output file.",
			Prohibits = "u",
			GroupId = "1_compress")]
		public string Output { get; set; }


		/// <summary>
		/// Gets or sets the configuration file with exclude patterns.
		/// </summary>
		[CommandLineOption(
			Name = "c",
			Aliases = "configuration",
			Description =
				"Specifies the configuration file with exclude patterns, one pattern per line. If file " +
				"is specified, the default exclude patterns are ignored.",
			Prohibits = "u",
			GroupId = "1_compress")]
		public string Configuration { get; set; }


		/// <summary>
		/// Gets or sets the list of exclude patterns.
		/// </summary>
		[CommandLineOption(
			Name = "e",
			Aliases = "exclude",
			Description = "Specifies the list of exclude patterns. If patterns are specified, the " +
				"default exclude patterns are ignored.",
			Prohibits = "u",
			GroupId = "1_compress")]
		public string Exclude { get; set; }

		#endregion

		#region Uninstallation

		[CommandLineOption(
			Name = "u",
			Aliases = "uninstall",
			Description = "Removes saved settings, i.e. cleans up the application footprint.",
			GroupId = "2_uninstall")]
		public bool Uninstall { get; set; }

		#endregion

		#region Help

		[CommandLineOption(
			Name = "?",
			Aliases = "h,help",
			Description = "Displays this help text.",
			GroupId = "3_help")]
		public bool Help { get; set; }

		#endregion
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Axis Communications
Sweden Sweden
Got my first computer in the 90's and loved it even though it sounded like a coffeemaker.

Now getting paid for designing cool applications, and drinks the coffee instead of listening to it being made.

Comments and Discussions