#!/usr/bin/env perl

use strict;
use warnings;

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

use Developer::Dashboard::CLI::Query qw(run_query_command);

# main(@ARGV)
# Runs the XML query command for Developer Dashboard.
# Input: command-line arguments from @ARGV and optional STDIN.
# Output: prints the selected XML value, then exits.
run_query_command( command => 'xmlq', args => \@ARGV );

__END__

=pod

=head1 NAME

xmlq - XML query command for Developer Dashboard

=head1 SYNOPSIS

  dashboard xmlq [path] [file]

=head1 DESCRIPTION

This command provides XML extraction for Developer Dashboard.

=for comment FULL-POD-DOC START

=head1 PURPOSE

This staged helper owns the public C<dashboard xmlq> command. It accepts a
path plus an optional input file, then hands the request to the shared query
runtime so parsing, file-vs-STDIN handling, and output formatting stay
consistent with the rest of the dashboard toolchain.

=head1 WHY IT EXISTS

It exists because XML inspection is part of the dashboard query family, but the
current XML behavior is intentionally minimal and should still stay behind the
same staged-helper and shared-runtime contract as the other query helpers.

=head1 WHEN TO USE

Use this file when changing the public C<dashboard xmlq> argv contract, the XML
helper examples, or the staged handoff into the shared query runtime.

=head1 HOW TO USE

Users run C<dashboard xmlq [path] [file]>. The staged helper selects the XML
backend in the shared query runtime, which accepts the file and path in either
order, reads STDIN when no file is given, and currently exposes the raw XML
payload under the C<_raw> key instead of pretending to support a full XML tree
query language. Use C<_raw>, C<$d>, or C<.> when you need the whole payload.

=head1 WHAT USES IT

It is used by the public C<dashboard xmlq> command, by shell snippets that want
a runtime-local XML inspection tool, and by query-helper coverage under C<t/>
that locks in the current minimal raw-payload contract.

=head1 EXAMPLES

  printf '<root><value>demo</value></root>' | dashboard xmlq _raw
  dashboard xmlq feed.xml '$d'
  dashboard xmlq '$d' feed.xml
  cat feed.xml | dashboard xmlq _raw

=for comment FULL-POD-DOC END

=cut
