--pick flag

This commit is contained in:
2026-09-15 11:42:41 +01:00
parent c72c0d0b79
commit b63f0ba927
4 changed files with 198 additions and 7 deletions
+14 -1
View File
@@ -46,7 +46,10 @@ Examples:
dirmd -o ./docs ~/repos/myproject --proton-drive
# Interactive TUI mode
dirmd --tui`,
dirmd --tui
# Pick specific files in vertical slices mode
dirmd -o ./docs ~/repos/myproject --vertical-slices --pick common/src/lib.rs --pick mssql-extractor/src/processor.rs`,
RunE: run,
}
@@ -67,6 +70,8 @@ Examples:
omitMd bool
tuiMode bool
instructions bool
pickPaths []string
smallTree bool
)
func Execute() {
@@ -93,6 +98,8 @@ func init() {
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.Flags().BoolVar(&instructions, "instructions", false, "include .dirmd instructions file if present in root")
rootCmd.Flags().StringArrayVar(&pickPaths, "pick", nil, "repeatable: relative path to file to include as pick (requires --vertical-slices)")
rootCmd.Flags().BoolVar(&smallTree, "small-tree", false, "use breadcrumb-only tree for picked files (default: full tree)")
}
func run(cmd *cobra.Command, args []string) error {
@@ -120,6 +127,10 @@ func run(cmd *cobra.Command, args []string) error {
return fmt.Errorf("--skip-frontend and --frontend-only are mutually exclusive")
}
if len(pickPaths) > 0 && !verticalSlices {
return fmt.Errorf("--pick requires --vertical-slices")
}
excludedExts := append(config.DefaultExts, extensions...)
if skipFrontend {
excludedExts = append(excludedExts, config.FrontendExts...)
@@ -141,6 +152,8 @@ func run(cmd *cobra.Command, args []string) error {
OmitTest: omitTest,
OmitMd: omitMd,
IncludeInstructions: instructions,
PickPaths: pickPaths,
SmallTree: smallTree,
}
if singleFile != "" {