This commit is contained in:
2026-08-27 15:24:18 +01:00
parent a2afce3f8d
commit 3ea14b91c0
10 changed files with 812 additions and 4 deletions
+15 -3
View File
@@ -10,6 +10,7 @@ import (
"dirmd/internal/config"
"dirmd/internal/drive"
"dirmd/internal/renderer"
"dirmd/internal/tui"
"dirmd/internal/walker"
)
@@ -51,7 +52,10 @@ Examples:
dirmd -o ./docs ~/repos/myproject --proton-drive
# Generate and upload to a specific remote path
dirmd -o ./docs ~/repos/myproject --proton-drive --drive-path /my-files/docs/api`,
dirmd -o ./docs ~/repos/myproject --proton-drive --drive-path /my-files/docs/api
# Interactive TUI mode
dirmd --tui`,
RunE: run,
}
@@ -70,6 +74,7 @@ Examples:
frontendOnly bool
omitTest bool
omitMd bool
tuiMode bool
)
func Execute() {
@@ -94,11 +99,18 @@ func init() {
rootCmd.Flags().BoolVar(&frontendOnly, "frontend-only", false, "include only frontend file types and README.md")
rootCmd.Flags().BoolVar(&omitTest, "omit-test", false, "exclude test files (Go *_test.go, Java *Test.java) and strip #[cfg(test)] blocks from Rust")
rootCmd.Flags().BoolVar(&omitMd, "omit-md", false, "omit all .md files except README.md")
rootCmd.MarkPersistentFlagRequired("output")
rootCmd.Flags().BoolVar(&tuiMode, "tui", false, "launch interactive TUI configuration wizard")
}
func run(cmd *cobra.Command, args []string) error {
if tuiMode {
return tui.Run()
}
if outputPath == "" {
return fmt.Errorf("-o is required (or use --tui for interactive mode)")
}
if drivePath != "" && !protonDrive {
return fmt.Errorf("--drive-path requires --proton-drive")
}