Skip to content

Commit

Permalink
Clarify command line args
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStovell committed Aug 20, 2012
1 parent c887bd6 commit 76f2dca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Note that packages that have already been deployed to the selected machines will

Every request requires an API key to be passed. This can be gotten from the Octopus web portal, by clicking the My Profile page.

octo ... -apikey=ABCDEF123456
octo ... --apiKey=ABCDEF123456

If your IIS server is set up to require Windows Authentication, the tool will automatically pass the currently logged in user's credentials. If this doesn't work, or you want to use a different user, simply add these two arguments:

Expand Down
20 changes: 12 additions & 8 deletions source/OctopusTools.Tests/Commands/OptionsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,26 @@ namespace OctopusTools.Tests.Commands
public class OptionsFixture
{
[Test]
[TestCase("--apiKey=abc123")]
[TestCase("--apikey=abc123")]
[TestCase("-apikey=abc123")]
[TestCase("--apikey=abc123")]
[TestCase("/apikey=abc123")]
public void ShouldBeCaseInsensitive(string parameter)
[TestCase("--apiKey=abc123", "-foo=bar")]
[TestCase("--apikey=abc123", "/foo=bar")]
[TestCase("-apikey=abc123", "--foo=bar")]
[TestCase("--apikey=abc123", "-foo=bar")]
[TestCase("/apikey=abc123", "--foo=bar")]
public void ShouldBeCaseInsensitive(string parameter1, string parameter2)
{
var apiKey = string.Empty;
var foo = string.Empty;

var optionSet = new OptionSet()
{
{"apiKey=", "API key", v => apiKey = v}
{"apiKey=", "API key", v => apiKey = v},
{"foo=", "Foo", v => foo = v}
};

optionSet.Parse(new[] {parameter});
optionSet.Parse(new[] {parameter1, parameter2});

Assert.That(apiKey, Is.EqualTo("abc123"));
Assert.That(foo, Is.EqualTo("bar"));
}
}
}

0 comments on commit 76f2dca

Please sign in to comment.