[Issue #4] Add issue dependency management commands #5

Merged
HugoNijhuis merged 2 commits from issue-4-issue-dependency-management into main 2026-01-06 12:59:30 +00:00
Showing only changes of commit 02893135ad - Show all commits

View File

@@ -192,7 +192,10 @@ func runDependenciesRemove(ctx stdctx.Context, cmd *cli.Command) error {
// - "owner/repo#123" (cross-repo)
func parseDependencyArg(arg, defaultOwner, defaultRepo string) (owner, repo string, index int64, err error) {
// Check for cross-repo format: owner/repo#123
if strings.Contains(arg, "/") && strings.Contains(arg, "#") {
// Ensure "/" comes before "#" to distinguish from same-repo "#123"
slashIdx := strings.Index(arg, "/")
hashIdx := strings.Index(arg, "#")
if slashIdx != -1 && hashIdx != -1 && slashIdx < hashIdx {
parts := strings.SplitN(arg, "#", 2)
if len(parts) != 2 {
return "", "", 0, fmt.Errorf("invalid dependency format: %s (expected owner/repo#index)", arg)