ndi-cli 0.25.0__tar.gz → 0.26.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/PKG-INFO +1 -1
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/pyproject.toml +1 -1
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/pyproject.toml.orig +1 -1
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/src/ndi_cli/__init__.py +1 -1
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/src/ndi_cli/_cli.py +1 -1
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/src/ndi_cli/_output.py +4 -1
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/src/ndi_cli/_systemone.py +11 -2
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/LICENSE +0 -0
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/README.md +0 -0
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/src/ndi_cli/_config.py +0 -0
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/src/ndi_cli/_docops.py +0 -0
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/src/ndi_cli/_entrypoint.py +0 -0
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/src/ndi_cli/_jobs.py +0 -0
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/src/ndi_cli/_local.py +0 -0
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/src/ndi_cli/_login.py +0 -0
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/src/ndi_cli/_render.py +0 -0
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/src/ndi_cli/_sources.py +0 -0
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/src/ndi_cli/_tools.py +0 -0
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/src/ndi_cli/_workspace.py +0 -0
- {ndi_cli-0.25.0 → ndi_cli-0.26.0}/src/ndi_cli/commands.py +0 -0
|
@@ -214,7 +214,7 @@ def _build_parser(*, in_agent_run: bool = False) -> argparse.ArgumentParser:
|
|
|
214
214
|
_docops.add_parsers(sub, common)
|
|
215
215
|
_jobs.add_parsers(sub, common)
|
|
216
216
|
_workspace.add_parsers(sub, common)
|
|
217
|
-
_systemone.add_parsers(sub,
|
|
217
|
+
_systemone.add_parsers(sub, default_timeout=DEFAULT_TIMEOUT_SECONDS)
|
|
218
218
|
return parser
|
|
219
219
|
|
|
220
220
|
|
|
@@ -49,7 +49,8 @@ def shortened(full: str, args, *, get_full: str = "rerun with --json") -> bool:
|
|
|
49
49
|
"""Whether ``full`` is too long for stdout; if so, tell stderr how to get it.
|
|
50
50
|
|
|
51
51
|
A file target is never shortened — the limit protects a reader's context,
|
|
52
|
-
and ``--save`` / ``--out-dir`` asked for the whole thing. ``
|
|
52
|
+
and ``--save`` / ``--out-dir`` asked for the whole thing. A limit of ``0``
|
|
53
|
+
asked for the text rendering, so nothing goes to stderr. ``get_full`` names
|
|
53
54
|
the command that prints it whole.
|
|
54
55
|
"""
|
|
55
56
|
if getattr(args, "save", None) or getattr(args, "out_dir", None):
|
|
@@ -57,6 +58,8 @@ def shortened(full: str, args, *, get_full: str = "rerun with --json") -> bool:
|
|
|
57
58
|
limit = output_limit()
|
|
58
59
|
if len(full) <= limit:
|
|
59
60
|
return False
|
|
61
|
+
if limit == 0:
|
|
62
|
+
return True
|
|
60
63
|
print(
|
|
61
64
|
f"note: output shortened — the full response is {len(full):,} chars, over the {limit:,} limit "
|
|
62
65
|
f"(${OUTPUT_LIMIT_ENV}); {get_full} for all of it",
|
|
@@ -15,15 +15,24 @@ from ndi_cli import _render
|
|
|
15
15
|
from ndi_cli._workspace import _dump_or_text
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
def add_parsers(sub: argparse._SubParsersAction,
|
|
18
|
+
def add_parsers(sub: argparse._SubParsersAction, *, default_timeout: float) -> None:
|
|
19
19
|
systemone = sub.add_parser(
|
|
20
20
|
"systemone",
|
|
21
|
-
parents=[common],
|
|
22
21
|
help="Answer noul, choice, and score questions about a state.",
|
|
23
22
|
description=(
|
|
24
23
|
"Answer typed questions about a state in one call. A VALUE is inline, @FILE reads a file, and @- reads stdin."
|
|
25
24
|
),
|
|
26
25
|
)
|
|
26
|
+
systemone.add_argument(
|
|
27
|
+
"--json", action="store_true", help="Always print the full response JSON, never the shortened text rendering."
|
|
28
|
+
)
|
|
29
|
+
systemone.add_argument(
|
|
30
|
+
"--timeout",
|
|
31
|
+
type=float,
|
|
32
|
+
default=default_timeout,
|
|
33
|
+
metavar="SECONDS",
|
|
34
|
+
help=f"HTTP timeout for the call (default {default_timeout:.0f}s).",
|
|
35
|
+
)
|
|
27
36
|
state = systemone.add_mutually_exclusive_group(required=True)
|
|
28
37
|
state.add_argument("--state", default=None, metavar="VALUE", help="The state as text.")
|
|
29
38
|
state.add_argument("--state-json", default=None, metavar="VALUE", help="The state as any JSON value.")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|