Skip to main content

Module shell

Module shell 

Source
Expand description

DID syntax and shell quoting for the command vgi repo init prints.

The printed cnm git adopt … line is meant to be copied into a shell, so every argument in it is either DID-core-validated or a normalised resource, and is quoted anyway: a value that needs no quoting is printed bare, anything else in single quotes.

Functions§

check_did
Check did against the DID-core did production (a DID, not a DID URL):
command_line
argv as one line a POSIX shell reads back as the same arguments.
quote
Quote arg for a POSIX shell: bare when every character is one no shell treats specially, otherwise in single quotes (a ' inside becoming '\'').