#!/usr/bin/env perl

use strict;
use warnings;

use FindBin qw($Bin);
use lib "$Bin/../lib";

use Developer::Dashboard::CLI::OpenFile qw(run_open_file_command);

# main(@ARGV)
# Runs the of open-file helper for Developer Dashboard.
# Input: command-line arguments from @ARGV and optional STDIN.
# Output: prints matching paths or execs the configured editor, then exits.
run_open_file_command( args => \@ARGV );

__END__

=pod

=head1 NAME

of - private open-file helper for Developer Dashboard

=head1 SYNOPSIS

  dashboard of [--print] [--line N] [--editor CMD] <file|scope> [pattern...]

=head1 DESCRIPTION

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

=for comment FULL-POD-DOC START

=head1 PURPOSE

This staged helper exposes C<dashboard of>, the short name for the dashboard
open-file command. It is the shell-facing entrypoint for direct file opens,
scoped regex search, Perl module lookup, Java dotted class lookup, and the
print-vs-editor decision that happens after resolution.

=head1 WHY IT EXISTS

It exists because file lookup is a frequent interactive task and should stay
fast to type, but the public switchboard still needs to stay thin. The helper
lets users type C<dashboard of ...> while the heavy search and ranking rules
stay in C<Developer::Dashboard::CLI::OpenFile>.

=head1 WHEN TO USE

Use this file when changing the short-form CLI contract for open-file behavior,
the staged-helper handoff, or the exact examples contributors see when they
look up how C<dashboard of> behaves.

=head1 HOW TO USE

Users run C<dashboard of [--print] [--line N] [--editor CMD] E<lt>file|scopeE<gt>
[pattern ...]>. Direct paths and C<file:line> arguments resolve immediately.
In scoped mode the first positional argument is the search root or saved alias,
and every extra positional argument is a case-insensitive regex that must match
the candidate path. One hit opens or prints that file; multiple hits are
listed. Perl module names such as C<Developer::Dashboard::CLI::Paths> resolve
through C<@INC>, and Java class names such as C<javax.jws.WebService> resolve
through source trees, source archives, or cached Maven source jars.

=head1 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 scoped regex lookup, Perl module
resolution, Java source lookup, and print-vs-editor behavior.

=head1 EXAMPLES

  dashboard of lib 'OpenFile\.pm$'
  dashboard of . "Ok\.js$"
  dashboard of Developer::Dashboard::CLI::Paths
  dashboard of javax.jws.WebService
  dashboard of --print bookmarks index

=for comment FULL-POD-DOC END

=cut
