summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-29 16:55:14 +0300
committerPaul Buetow <paul@buetow.org>2026-05-29 16:55:14 +0300
commit649a41dc0f0cbfa697408db2f006d106ba655933 (patch)
tree15238d5bda9f32d93e8da7292bd2fdeb7082af6f
parent364c119fff5f9b49cca9be54e538c5209259508c (diff)
fix(showcase): remove unsupported flags from CLI (tq)
-rw-r--r--README.md18
-rw-r--r--internal/cmd/showcase.go26
-rw-r--r--internal/cmd/showcase_test.go45
3 files changed, 63 insertions, 26 deletions
diff --git a/README.md b/README.md
index 47031aa..851cda9 100644
--- a/README.md
+++ b/README.md
@@ -217,14 +217,11 @@ gitsyncer showcase
# Force regeneration of all summaries
gitsyncer showcase --force
-# Custom output path
-gitsyncer showcase --output ~/my-showcase.md
+# Generate showcase for one repository
+gitsyncer showcase --repo gitsyncer
-# Different output format
-gitsyncer showcase --format markdown
-
-# Exclude certain repositories
-gitsyncer showcase --exclude "test-.*"
+# Use a specific AI tool
+gitsyncer showcase --ai-tool opencode
```
### Repository Management
@@ -429,8 +426,11 @@ gitsyncer showcase
# Force regeneration of all summaries
gitsyncer showcase --force
-# Custom output path and format
-gitsyncer showcase --output ~/showcase.md --format markdown
+# Generate showcase for one repository
+gitsyncer showcase --repo gitsyncer
+
+# Use a specific AI tool
+gitsyncer showcase --ai-tool opencode
```
### Output
diff --git a/internal/cmd/showcase.go b/internal/cmd/showcase.go
index 0433ad3..741b4c8 100644
--- a/internal/cmd/showcase.go
+++ b/internal/cmd/showcase.go
@@ -10,9 +10,6 @@ import (
var (
forceRegenerate bool
- outputPath string
- outputFormat string
- excludePattern string
showcaseAITool string
showcaseRepo string
)
@@ -29,17 +26,11 @@ and code snippets. By default uses opencode (via ollama launch with glm-5.1:clou
# Force regeneration of all summaries
gitsyncer showcase --force
- # Custom output path
- gitsyncer showcase --output ~/my-showcase.md
-
- # Different output format
- gitsyncer showcase --format markdown
-
- # Exclude certain repositories
- gitsyncer showcase --exclude "test-.*"
-
# Use a specific AI tool
- gitsyncer showcase --ai-tool opencode`,
+ gitsyncer showcase --ai-tool opencode
+
+ # Generate showcase for one repository
+ gitsyncer showcase --repo gitsyncer`,
Run: func(cmd *cobra.Command, args []string) {
flags := buildFlags()
flags.Showcase = true
@@ -49,7 +40,11 @@ and code snippets. By default uses opencode (via ollama launch with glm-5.1:clou
flags.SyncRepo = showcaseRepo
}
- fmt.Println("Running showcase generation for all repositories...")
+ if flags.SyncRepo != "" {
+ fmt.Printf("Running showcase generation for repository: %s...\n", flags.SyncRepo)
+ } else {
+ fmt.Println("Running showcase generation for all repositories...")
+ }
exitCode := cli.HandleShowcaseOnly(cfg, flags)
os.Exit(exitCode)
},
@@ -60,9 +55,6 @@ func init() {
// Showcase flags
showcaseCmd.Flags().BoolVarP(&forceRegenerate, "force", "f", false, "force regeneration of cached summaries")
- showcaseCmd.Flags().StringVarP(&outputPath, "output", "o", "", "custom output eath (default: ~/git/foo.zone-content/gemtext/about/showcase.gmi.tpl)")
- showcaseCmd.Flags().StringVar(&outputFormat, "format", "gemtext", "output format: gemtext, markdown, html")
- showcaseCmd.Flags().StringVar(&excludePattern, "exclude", "", "exclude repos matching pattern")
showcaseCmd.Flags().StringVar(&showcaseAITool, "ai-tool", "opencode", "AI tool for summaries: opencode, hexai, claude, amp, or claude-code (default tries opencode→hexai→claude→amp)")
showcaseCmd.Flags().StringVar(&showcaseRepo, "repo", "", "only generate showcase for a single repository")
}
diff --git a/internal/cmd/showcase_test.go b/internal/cmd/showcase_test.go
new file mode 100644
index 0000000..d120d06
--- /dev/null
+++ b/internal/cmd/showcase_test.go
@@ -0,0 +1,45 @@
+package cmd
+
+import (
+ "strings"
+ "testing"
+)
+
+func TestShowcaseCommand_FlagsMatchImplementedBehavior(t *testing.T) {
+ t.Parallel()
+
+ if showcaseCmd.Flags().Lookup("output") != nil {
+ t.Fatal("showcase command should not expose unsupported --output flag")
+ }
+ if showcaseCmd.Flags().Lookup("format") != nil {
+ t.Fatal("showcase command should not expose unsupported --format flag")
+ }
+ if showcaseCmd.Flags().Lookup("exclude") != nil {
+ t.Fatal("showcase command should not expose unsupported --exclude flag")
+ }
+
+ if showcaseCmd.Flags().Lookup("force") == nil {
+ t.Fatal("showcase command must expose --force")
+ }
+ if showcaseCmd.Flags().Lookup("ai-tool") == nil {
+ t.Fatal("showcase command must expose --ai-tool")
+ }
+ if showcaseCmd.Flags().Lookup("repo") == nil {
+ t.Fatal("showcase command must expose --repo")
+ }
+}
+
+func TestShowcaseCommand_ExamplesDoNotMentionUnsupportedFlags(t *testing.T) {
+ t.Parallel()
+
+ example := showcaseCmd.Example
+ if strings.Contains(example, "--output") {
+ t.Fatal("showcase example should not mention unsupported --output")
+ }
+ if strings.Contains(example, "--format") {
+ t.Fatal("showcase example should not mention unsupported --format")
+ }
+ if strings.Contains(example, "--exclude") {
+ t.Fatal("showcase example should not mention unsupported --exclude")
+ }
+}