diff --git a/cmd/clone.go b/cmd/clone.go index 8b76ac1..85ea626 100644 --- a/cmd/clone.go +++ b/cmd/clone.go @@ -32,13 +32,27 @@ var cloneCmd = &cobra.Command{ Run: cloneRepo, } -func cloneRepo(cmd *cobra.Command, _ []string) { +func cloneRepo(cmd *cobra.Command, args []string) { internal.Setup() projects := internal.FuzzyLines(internal.ProjectPath) if len(projects) == 0 { return } + if len(args) > 0 { + prefix := args[0] + var filtered []string + for _, p := range projects { + if strings.HasPrefix(p, prefix) { + filtered = append(filtered, p) + } + } + if len(filtered) == 0 { + return + } + projects = filtered + } + isHTTPS, _ := cmd.Flags().GetBool("https") isCurrent, _ := cmd.Flags().GetBool("current") for _, project := range projects {