OpenSite/Reference/Commands/Set a quantity: Difference between revisions

From BathAfrica Documentation
Jump to navigation Jump to search
Publish Cursor documentation reconciled with OpenSite source 77c3fee; tests not rerun
 
Use BathAfrica sidebar contents without duplicate inline contents box
Line 1: Line 1:
__NOTOC__
{{BathAfrica Command
{{BathAfrica Command
|review=Development documentation for OpenSite 0.0.1, source snapshot 77c3fee (Phase 13C). Reviewed against implementation on 29 October 2026. Tests and the Windows desktop were not rerun for this publication; this is not a released-product support claim.
|review=Development documentation for OpenSite 0.0.1, source snapshot 77c3fee (Phase 13C). Reviewed against implementation on 29 October 2026. Tests and the Windows desktop were not rerun for this publication; this is not a released-product support claim.

Revision as of 13:10, 29 October 2026


Review notice: Development documentation for OpenSite 0.0.1, source snapshot 77c3fee (Phase 13C). Reviewed against implementation on 29 October 2026. Tests and the Windows desktop were not rerun for this publication; this is not a released-product support claim.

Change one quantity through opensite.document.set_quantity, recompute, and save.

Stable identifier
cli.document.set

Implementation milestone

Roadmap phase 1 (historical Phase 1).

Units

The command interprets --value in --unit and stores the canonical SI quantity. The unit id must already be registered.

Terminal example

opensite-cli document set section.osdoc --property width --value 0.25 --unit m

Python access

examples/python/document_edit.py calls document.set_quantity with a QuantityArgument built from parse_quantity('250 mm').

Output

Stdout is the inspected document after the save. Width 0.25 m and height 0.60 m give area 0.15 m².

Errors

A --value or --object that does not consume the whole argument exits 2 and reports that an argument is not a valid number. That includes a trailing suffix, a negative or out-of-range object id, and a non-finite quantity such as inf or nan. Decimal and scientific forms such as 4e-1 are accepted. The decimal mark is .. The check does not use the machine locale. Exit 2 does not modify the file. A missing required flag exits 2. A rejected edit exits 1 with the status message. An allocation or execution failure exits 1 with its own message.

Limitations

If the file has exactly one object, --object may be omitted. An object id is an integer from 1 through 9007199254740991. Derived properties cannot be edited. This does not switch the unit-preference profile.

Verification evidence

Repository evidence references (not rerun for this publication): CTest cli.document, including --value abc, 0.25m, inf, a negative object id, an oversized object id, an unchanged file after those rejections, and --value 4e-1.


Documentation basis

Source-reviewed against development commit 77c3fee13944bcc4b5d487c77eb1f82fbe4c6ea7, branch feature/phase-13c-properties-python-expressions. This review inspected the implementation and repository evidence; it did not run the Windows application or repeat CTest.

  • src/cli/main.cpp
  • src/cli/document_commands.cpp
  • src/cli/preference_commands.cpp
  • src/application/builtins.cpp

OpenSite overview · Reference · Guides