Skip to content

Commit 3f32e7c

Browse files
Make URL validation error messages generic to support CLI-specific option name overrides and remove trailing blank lines
1 parent 11c53c4 commit 3f32e7c

File tree

7 files changed

+4
-197
lines changed

7 files changed

+4
-197
lines changed

src/Octoshift/Commands/DownloadLogs/DownloadLogsCommandArgs.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ public override void Validate(OctoLogger log)
1818
{
1919
if (GithubOrg.IsUrl())
2020
{
21-
throw new OctoshiftCliException($"The --github-org option expects an organization name, not a URL. Please provide just the organization name (e.g., 'my-org' instead of 'https://github.com/my-org').");
21+
throw new OctoshiftCliException("The organization name option expects an organization name, not a URL. Please provide just the organization name (e.g., 'my-org' instead of 'https://github.com/my-org').");
2222
}
2323

2424
if (GithubRepo.IsUrl())
2525
{
26-
throw new OctoshiftCliException($"The --github-repo option expects a repository name, not a URL. Please provide just the repository name (e.g., 'my-repo' instead of 'https://github.com/my-org/my-repo').");
26+
throw new OctoshiftCliException("The repository name option expects a repository name, not a URL. Please provide just the repository name (e.g., 'my-repo' instead of 'https://github.com/my-org/my-repo').");
2727
}
2828
}
2929
}

src/Octoshift/Commands/GenerateMannequinCsv/GenerateMannequinCsvCommandArgs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public override void Validate(OctoLogger log)
1717
{
1818
if (GithubOrg.IsUrl())
1919
{
20-
throw new OctoshiftCliException($"The --github-org option expects an organization name, not a URL. Please provide just the organization name (e.g., 'my-org' instead of 'https://github.com/my-org').");
20+
throw new OctoshiftCliException("The organization name option expects an organization name, not a URL. Please provide just the organization name (e.g., 'my-org' instead of 'https://github.com/my-org').");
2121
}
2222
}
2323
}

src/Octoshift/Commands/ReclaimMannequin/ReclaimMannequinCommandArgs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public override void Validate(OctoLogger log)
2020
{
2121
if (GithubOrg.IsUrl())
2222
{
23-
throw new OctoshiftCliException($"The --github-org option expects an organization name, not a URL. Please provide just the organization name (e.g., 'my-org' instead of 'https://github.com/my-org').");
23+
throw new OctoshiftCliException("The organization name option expects an organization name, not a URL. Please provide just the organization name (e.g., 'my-org' instead of 'https://github.com/my-org').");
2424
}
2525

2626
if (string.IsNullOrEmpty(Csv) && (string.IsNullOrEmpty(MannequinUser) || string.IsNullOrEmpty(TargetUser)))

src/OctoshiftCLI.Tests/StringExtensionsTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,3 @@ public void IsUrl_Detects_URLs_Correctly(string value, bool expectedResult)
4141
}
4242
}
4343
}
44-

src/OctoshiftCLI.Tests/gei/Commands/MigrateOrg/MigrateOrgCommandArgsTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,3 @@ public void Validate_Throws_When_GithubTargetEnterprise_Is_Url()
8383
}
8484
}
8585
}
86-

src/OctoshiftCLI.Tests/gei/Commands/MigrateRepo/MigrateRepoCommandArgsTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,4 +378,3 @@ public void Validate_Throws_When_TargetRepo_Is_Url()
378378
}
379379
}
380380
}
381-

test-url-validation.sh

Lines changed: 0 additions & 190 deletions
This file was deleted.

0 commit comments

Comments
 (0)