Skip to content

Commit

Permalink
Merge pull request #5 from travismc1/WarningForJobOutputType
Browse files Browse the repository at this point in the history
Provide warning if specifying more than one job output type
  • Loading branch information
ogail committed Nov 21, 2014
2 parents ce00ba9 + 37c423f commit db292ec
Showing 1 changed file with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,21 +136,39 @@ protected override void EndProcessing()
this.command.CurrentSubscription = this.GetCurrentSubscription(this.Subscription, this.Certificate);
this.AssertTaskLogsDirectorySpecified(this.TaskLogsDirectory);

if (this.StandardError.IsPresent)
int numSpecifiedOutputTypes = 0;
string selectedOutputType = "Standard Output";
this.command.OutputType = JobOutputType.StandardOutput;

if (this.StandardOutput.IsPresent)
{
this.command.OutputType = JobOutputType.StandardError;
numSpecifiedOutputTypes++;
}
else if (this.TaskSummary.IsPresent)

if (this.DownloadTaskLogs.IsPresent)
{
this.command.OutputType = JobOutputType.TaskLogs;
selectedOutputType = "Task Logs";
numSpecifiedOutputTypes++;
}

if (this.TaskSummary.IsPresent)
{
this.command.OutputType = JobOutputType.TaskSummary;
selectedOutputType = "Task Summary";
numSpecifiedOutputTypes++;
}
else if (this.DownloadTaskLogs.IsPresent)

if (this.StandardError.IsPresent)
{
this.command.OutputType = JobOutputType.TaskLogs;
this.command.OutputType = JobOutputType.StandardError;
selectedOutputType = "Standard Error";
numSpecifiedOutputTypes++;
}
else

if (numSpecifiedOutputTypes > 1)
{
this.command.OutputType = JobOutputType.StandardOutput;
this.WriteWarning(String.Format("This cmdlet supports specifying only one job output type. Only {0} will be returned", selectedOutputType));
}

try
Expand Down

0 comments on commit db292ec

Please sign in to comment.