NAME

open-file - private open-file helper for Developer Dashboard

SYNOPSIS

d2 open-file [--print] [--line N] [--editor CMD] <file|scope> [pattern...]

DESCRIPTION

This private helper is staged under ~/.developer-dashboard/cli/dd/ so the main d2 command can keep file-opening behaviour available without installing a generic executable into the user's global PATH.

PURPOSE

This staged helper exposes d2 open-file, the long-form file lookup command. It is the user-facing wrapper for direct file opens, scoped regex search, Perl module lookup, Java dotted class lookup, and the final print-vs-editor action chosen by the shared open-file runtime.

WHY IT EXISTS

It exists because open-file behavior is richer than a one-line shell alias. The helper keeps the public command discoverable while leaving ranking, archive lookup, and editor-exec behavior in one tested Perl module.

WHEN TO USE

Use this file when changing the public d2 open-file argv contract, the staged-helper handoff, or the examples contributors use to understand the full-featured open-file behavior.

HOW TO USE

Users run d2 open-file [--print] [--line N] [--editor CMD] <file|scope> [pattern ...]. Direct paths and file:line values are opened immediately. Scoped mode treats the first positional argument as the root and every remaining positional argument as a case-insensitive regex that must match. A single result opens or prints that file; multiple results are listed. Perl module names are converted to path lookups under @INC, while Java class names are resolved through source trees, source jars, and cached Maven source downloads.

WHAT USES IT

It is used by developers jumping to source files from the shell, by open-file regression tests, and by docs that explain direct paths, scoped regex lookup, Perl modules, Java classes, and print-vs-editor behavior.

EXAMPLES

d2 open-file lib 'OpenFile\.pm$'
d2 open-file path/to/file.txt
d2 open-file . "Ok\.js$"
d2 open-file Developer::Dashboard::CLI::Paths
d2 open-file javax.jws.WebService
d2 open-file --print bookmarks index