Type to search pages and rules.

Browse pages

Rename Record

Markdown

Name#

litespec rename renames a record identifier and rewrites every link.

Synopsis#

Shell
litespec rename <old> <new> [--root <path>] [--help]

Description#

This command renames one record identifier across the consumer repository. It moves the record file to the path the new identifier owns, moves the explanation file beside it when one exists, updates the record fields, and rewrites every citation of the old identifier in record files, explanation files, and documents, so no link points at the old name after the rename. Record files are written back in canonical form. A use-case file that already sits beside its aggregate stays in its folder and takes the new file name. The repository stays resolvable at every commit.

Both arguments are full record identifiers, such as use-case/lending.borrow-copy. The command refuses a new identifier a record already carries and an old identifier no record carries.

Run it for every identifier rename, as litespec/core/authoring#rewrite-every-link-on-a-rename states. Never rename by moving the file by hand.

Arguments#

ArgumentMeaning
<old>The full identifier the record carries today.
<new>The full identifier the record takes.

Options#

OptionDefaultEffect
--root <path>the working directorySelects the consumer repository to change.
--helpoffPrints the synopsis, the options, and the exit codes, then exits zero.

Exit Codes#

CodeMeaning
0The identifier was renamed and every link rewritten.
1The run failed after the checks passed.
2The old identifier names no record, the new identifier is taken, or an option is unknown.

Examples#

Rename a use case and rewrite every citation together:

Shell
litespec rename use-case/lending.borrow-copy use-case/lending.lend-copy

Underneath#

Nothing beneath this command is separately runnable.