Man page - sdml-view(1)
Packages contains this manual
Manual
SDML
NAMESYNOPSIS
DESCRIPTION
Arguments:
OPTIONS
NAME
sdml view - View formatted module source.
SYNOPSIS
sdml view [ OPTIONS ] [ MODULE ]
DESCRIPTION
View formatted module source.
This command will generate source code from a module file, which at first seems redundant. However, this view provides levels of detail that allow for an overview of module definitions. The β--levelβ argument can be used to elide content and get an overview of a module.
- Definitions (default) :: Show only the definitions in the module, any definition body will be elided, for an overview of the module contents. Elided definitions are followed by β";; ..."β.
βββtext ??? sdml view --level definitions -i examples/example.sdm module example <https://example.com/api> is
import [ dc xsd ]
datatype Uuid <- sdml:string ;; ...
entity Example ;; ...
end βββ
- Members :: Show definitions in the module and show the members of product types and variants of sum types but not their bodies if present.
βββtext ??? sdml view --level members -i examples/example.sdm module example <https://example.com/api> is
import [ dc xsd ]
datatype Uuid <- sdml:string ;; ...
entity Example is version -> Uuid name -> sdml:string ;; ... end
end βββ
- Full :: Show all contents of the module.
βββtext ??? sdml view --level full -i examples/example.sdm module example <https://example.com/api> is
import [ dc xsd ]
datatype Uuid <- sdml:string is @xsd:pattern = "[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}" end
entity Example is version -> Uuid name -> sdml:string is @dc:description = "the name of this thing"@en end end
end βββ
Indentation level can also be specified, although the default remains 2 spaces.
Arguments:
[MODULE]
SDML module, loaded using the standard resolver
OPTIONS
|
-l , --level <LEVEL> |
[default: definitions]
Possible values: - definitions: Top-level definitions, incomplete - members: Top-level definitions and members, incomplete - full: Full source
|
-s , --indent-spaces <INDENT_SPACES> |
Set the number of spaces for indentation
[default: 2]
|
-o , --output <OUTPUT> |
File name to write to, or β-β to write to stdout
[default: -]
|
-i , --input <INPUT> |
Input SDML file name to read from, or β-β to read from stdin
[default: -]
|
-h , --help |
Print help (see a summary with β-hβ)
|
-V , --version |
Print version