refactor(cli,server): rename the --target flag to --graph (no alias)

The graph-selection flag is now `--graph` (the canonical noun, matching
`graphs:`/`cli.graph`) with NO `--target` compat alias — a clean break, to avoid
two-names-for-one-thing confusion. Applied across the 21 `omnigraph` subcommands
and the `omnigraph-server` binary (the field stays `target` internally;
`value_name = "GRAPH"` keeps help text clean). Updates the user-facing "no graph to
serve" and stored-query selection-hint error messages, plus the two cli.rs tests
that drove `--target`.

Breaking: `--target` is removed (now an unknown-flag error); use `--graph`. `uri`
is unchanged (positional or `--uri` per command — deliberately not folded into a
shared arg, since the two uri patterns can't share one flattened definition without
a breaking uri-form change). `--target-branch` (policy explain) is unrelated and
untouched. Code comments and docs still referencing `--target` are swept in L8 with
the docs.
This commit is contained in:
Ragnor Comerford 2026-06-03 18:34:48 +02:00
parent f3331edd51
commit fada7cf404
No known key found for this signature in database
4 changed files with 28 additions and 28 deletions

View file

@ -2513,7 +2513,7 @@ fn queries_list_requires_graph_selection_for_per_graph_only_registries() {
);
let stderr = String::from_utf8_lossy(&output.stderr);
assert!(
stderr.contains("local") && stderr.contains("--target local"),
stderr.contains("local") && stderr.contains("--graph local"),
"error must name the graph and give a concrete selection hint; stderr:\n{stderr}"
);
}
@ -2550,7 +2550,7 @@ fn queries_list_without_graph_selection_lists_top_level_registry() {
fn queries_list_unknown_target_errors() {
// `queries list` opens no graph URI, so unknown-graph validation can't ride
// along on URI resolution the way it does for every other command. An
// unknown `--target` must still error (naming the graph) instead of
// unknown `--graph` must still error (naming the graph) instead of
// silently falling back to the top-level registry and showing the wrong
// (or empty) catalog.
let graph = SystemGraph::loaded();
@ -2570,7 +2570,7 @@ fn queries_list_unknown_target_errors() {
cli()
.arg("queries")
.arg("list")
.arg("--target")
.arg("--graph")
.arg("nonexistent")
.arg("--config")
.arg(&config),