Skip to content

Commit 976df6a

Browse files
committed
Updated AssemblyInfo and readme
1 parent 38a066f commit 976df6a

File tree

3 files changed

+49
-27
lines changed

3 files changed

+49
-27
lines changed

README.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,56 @@
33
[![Build status](https://ci.appveyor.com/api/projects/status/936bilffko47p63b?svg=true)](https://ci.appveyor.com/project/jpdillingham/utility-commandline-arguments)
44
[![Build Status](https://travis-ci.org/jpdillingham/Utility.CommandLine.Arguments.svg?branch=master)](https://travis-ci.org/jpdillingham/Utility.CommandLine.Arguments)
55
[![codecov](https://codecov.io/gh/jpdillingham/Utility.CommandLine.Arguments/branch/master/graph/badge.svg)](https://codecov.io/gh/jpdillingham/Utility.CommandLine.Arguments)
6+
[![NuGet version](https://img.shields.io/nuget/v/Utility.CommandLine.Arguments.svg)](https://www.nuget.org/packages/Utility.CommandLine.Arguments/)
67
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/jpdillingham/Utility.CommandLine.Arguments/blob/master/LICENSE)
78

8-
A C# .NET Class Library containing tools for parsing command line arguments for console applications.
9+
A C# .NET Class Library containing tools for parsing the command line arguments of console applications.
910

1011
## Why?
1112

1213
I needed a solution for parsing command line arguments and didn't like the existing options.
1314

15+
## Installation
16+
17+
Install from the NuGet gallery GUI or with the Package Manager Console using the following command:
18+
19+
```Install-Package Utility.CommandLine.Arguments```
20+
21+
## Quick Start
22+
23+
Create private static properties in the class containing your ```Main()``` and mark them with the ```Argument``` attribute, assigning short and long names. Invoke
24+
the ```Arguments.Populate()``` method within ```Main()```, then implement the rest of your logic.
25+
26+
The library will populate your properties with the values
27+
specified in the command line arguments.
28+
29+
```c#
30+
internal class Program
31+
{
32+
[Argument('b', "boolean")]
33+
private static bool Bool { get; set; }
34+
35+
[Argument('f', "float")]
36+
private static double Double { get; set; }
37+
38+
[Argument('i', "integer")]
39+
private static int Int { get; set; }
40+
41+
[Argument('s', "string")]
42+
private static string String { get; set; }
43+
44+
private static void Main(string[] args)
45+
{
46+
Arguments.Populate();
47+
48+
Console.WriteLine("String: " + String);
49+
Console.WriteLine("Bool: " + Bool);
50+
Console.WriteLine("Int: " + Int);
51+
Console.WriteLine("Double: " + Double);
52+
}
53+
}
54+
```
55+
1456
## Grammar
1557

1658
The grammar supported by this library is designed to follow the guidelines set forth in the publication
@@ -19,7 +61,7 @@ located [here](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap1
1961

2062
Each argument is treated as a key-value pair, regardless of whether a value is present. The general format is as follows:
2163

22-
```[-|--|/]argument-name[=|:| ]["|']value['|"]```
64+
```<-|--|/>argument-name<=|:| >["|']value['|"]```
2365

2466
The key-value pair may begin with a single dash, a pair of dashes (double dash), or a forward slash. Single and double dashes indicate the use of short
2567
or long names, respectively, which are covered below. The forward slash may represent either, but does not allow for the grouping of parameterless
Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,15 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

5-
// General Information about an assembly is controlled through the following
6-
// set of attributes. Change these attribute values to modify the information
7-
// associated with an assembly.
84
[assembly: AssemblyTitle("Utility.CommandLine.Arguments")]
9-
[assembly: AssemblyDescription("")]
5+
[assembly: AssemblyDescription("A C# .NET Class Library containing tools for parsing the command line arguments of console applications.")]
106
[assembly: AssemblyConfiguration("")]
117
[assembly: AssemblyCompany("")]
128
[assembly: AssemblyProduct("Utility.CommandLine.Arguments")]
13-
[assembly: AssemblyCopyright("Copyright © 2017")]
9+
[assembly: AssemblyCopyright("Copyright (c) 2017 JP Dillingham (jp@dillingham.ws)")]
1410
[assembly: AssemblyTrademark("")]
1511
[assembly: AssemblyCulture("")]
16-
17-
// Setting ComVisible to false makes the types in this assembly not visible
18-
// to COM components. If you need to access a type in this assembly from
19-
// COM, set the ComVisible attribute to true on that type.
2012
[assembly: ComVisible(false)]
21-
22-
// The following GUID is for the ID of the typelib if this project is exposed to COM
2313
[assembly: Guid("b739dd22-4bd3-4d17-a351-33d129e9fe30")]
24-
25-
// Version information for an assembly consists of the following four values:
26-
//
27-
// Major Version
28-
// Minor Version
29-
// Build Number
30-
// Revision
31-
//
32-
// You can specify all the values or you can default the Build and Revision Numbers
33-
// by using the '*' as shown below:
34-
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
14+
[assembly: AssemblyVersion("1.0.0")]
15+
[assembly: AssemblyFileVersion("1.0.0")]

Utility.CommandLine.Arguments/Utility.CommandLine.Arguments.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<DefineConstants>TRACE</DefineConstants>
2929
<ErrorReport>prompt</ErrorReport>
3030
<WarningLevel>4</WarningLevel>
31+
<DocumentationFile>bin\Release\Utility.CommandLine.Arguments.XML</DocumentationFile>
3132
</PropertyGroup>
3233
<ItemGroup>
3334
<Reference Include="System" />

0 commit comments

Comments
 (0)