okf-cli
Safe HaskellNone
LanguageGHC2024

Okf.Cli

Description

Top-level CLI entry point for okf.

Synopsis

Documentation

data ConceptsOptions Source #

Constructors

ConceptsOptions 

Fields

Instances

Instances details
Show ConceptsOptions Source # 
Instance details

Defined in Okf.Cli

Eq ConceptsOptions Source # 
Instance details

Defined in Okf.Cli

data GraphOptions Source #

Constructors

GraphOptions 

Fields

Instances

Instances details
Show GraphOptions Source # 
Instance details

Defined in Okf.Cli

Eq GraphOptions Source # 
Instance details

Defined in Okf.Cli

data IdOptions Source #

Constructors

IdOptions 

Instances

Instances details
Show IdOptions Source # 
Instance details

Defined in Okf.Cli

Eq IdOptions Source # 
Instance details

Defined in Okf.Cli

data IdSub Source #

Constructors

IdNext !Text 
IdList 

Instances

Instances details
Show IdSub Source # 
Instance details

Defined in Okf.Cli

Methods

showsPrec :: Int -> IdSub -> ShowS #

show :: IdSub -> String #

showList :: [IdSub] -> ShowS #

Eq IdSub Source # 
Instance details

Defined in Okf.Cli

Methods

(==) :: IdSub -> IdSub -> Bool #

(/=) :: IdSub -> IdSub -> Bool #

data IndexOptions Source #

Constructors

IndexOptions 

Instances

Instances details
Show IndexOptions Source # 
Instance details

Defined in Okf.Cli

Eq IndexOptions Source # 
Instance details

Defined in Okf.Cli

data ConfigCommand Source #

Instances

Instances details
Show ConfigCommand Source # 
Instance details

Defined in Okf.Cli

Eq ConfigCommand Source # 
Instance details

Defined in Okf.Cli

data LogAddOptions Source #

Constructors

LogAddOptions 

Fields

Instances

Instances details
Show LogAddOptions Source # 
Instance details

Defined in Okf.Cli

Eq LogAddOptions Source # 
Instance details

Defined in Okf.Cli

data LogOptions Source #

Constructors

LogOptions 

Instances

Instances details
Show LogOptions Source # 
Instance details

Defined in Okf.Cli

Eq LogOptions Source # 
Instance details

Defined in Okf.Cli

data LogSub Source #

Instances

Instances details
Show LogSub Source # 
Instance details

Defined in Okf.Cli

Eq LogSub Source # 
Instance details

Defined in Okf.Cli

Methods

(==) :: LogSub -> LogSub -> Bool #

(/=) :: LogSub -> LogSub -> Bool #

data Options Source #

Constructors

Options 

Fields

Instances

Instances details
Show Options Source # 
Instance details

Defined in Okf.Cli

Eq Options Source # 
Instance details

Defined in Okf.Cli

Methods

(==) :: Options -> Options -> Bool #

(/=) :: Options -> Options -> Bool #

data ShowOptions Source #

Constructors

ShowOptions 

Fields

Instances

Instances details
Show ShowOptions Source # 
Instance details

Defined in Okf.Cli

Eq ShowOptions Source # 
Instance details

Defined in Okf.Cli

computationReport :: [Concept] -> [Text] Source #

The lines okf computations prints, as data. Pure and separate from runComputations so a test can assert the whole report rather than only the accessors behind it; renderProfileDetail is exported for the same reason.

Concepts arrive in walkBundle order and keep it. Column widths are computed over the selected rows only, so one unrelated long concept ID elsewhere in the bundle cannot pad this report.

conceptReport :: [Text] -> [Concept] -> [Text] Source #

The lines okf concepts prints, as data: concept ID, type, one column per requested key, and title last. Pure and separate from runConcepts so a test can assert the whole report rather than only the accessors behind it, as computationReport and renderProfileDetail already are.

The three default columns are the ones conceptCandidates shows in the interactive concept picker, so the two listings agree.

title comes last and is never padded, so a long title cannot push anything off the right edge and a concept with no title simply ends the line. Column widths are computed over the rows actually printed, so one unrelated long concept ID elsewhere in the bundle cannot pad a filtered listing.

conceptReportJson :: [Text] -> [Concept] -> Value Source #

The rows okf concepts --json emits.

title is null when the concept has none, and fields is present even when no key was requested, so a consumer never has to test for it. The values under fields are the raw frontmatter values rather than the display text a column shows: a JSON consumer wants a list back as a list.

profileRegistryEnvVar :: String Source #

Environment override for the registry okf profile reads.

renderProfileDetail :: Text -> ProfileSpec -> [Text] Source #

One profile's complete rule set. Every optional field prints as (none) rather than being omitted, so the output shape does not change between profiles and stays reliable to eyeball or grep. Type rules print in the order the profile declares them, since that order is the author's.

renderProfileViolation :: CompiledProfile -> [Concept] -> ProfileViolation -> Text Source #

One deviation as one line. The ProfileSpec is here only so a missing required field can carry the profile's own explanation of what that field is for; every other case ignores it.

Exported so a test can assert a whole diagnostic line rather than only the accessors behind it, as computationReport and renderProfileDetail already are. The constructors that quote a frontmatter value back to the author ignore both the CompiledProfile and the concept list, so such a test can pass any compiled profile and an empty list.

renderRegistryTable :: [RegistryEntry] -> [Text] Source #

An aligned table: a header row plus one row per profile, columns padded to their widest value. Pure so it can be tested without evaluating any Dhall.

DESCRIPTION comes last so the existing columns keep their positions and a long description cannot push anything off the right edge. Nothing follows it, so it is never padded; an absent description reads -, matching ID FIELD.