Skip to content

Filtering Mechanisms

Archmage employs multiple filtering mechanisms to control the inclusion of columns, rows, fields, config entries and tree nodes during data export and code generation.

Mechanism Acts on Description
Index table Worksheet First worksheet (with ** in A1) filtering worksheets via wildcard patterns View
# Column, row, or worksheet Universal comment marker to skip columns, rows, or worksheets View
enabled Column or row Header cell containing a boolean or env@VAR to control column or row inclusion View
Brace flags Field Name suffix in curly braces (such as {en}) to define field variants, evaluated against --brace-flags / -b View
xflags* Field Scenario flags to control field inclusion, evaluated against --xflags / -x View
tags* Field General-purpose flags to control field inclusion and exclusion, evaluated against --tags and --tags-xx View
minver* Field Minimum semantic version required (e.g. minver=1.2.0) for field inclusion, compared against --semver View
switch + case Field Combination of a switch field and multiple case-bound fields; only matching fields are allowed to have values. Each config entry may have a different switch value. View
condition Config entry or tree node Special field to filter config entries or tree nodes using expressions and rich matching rules (supporting all *-marked mechanisms, their combinations, and more) View
cflags* Condition flags, evaluated against --cflags; used only within condition View
env* Environment variable (e.g. env@VAR); used only within enabled and condition View

As a matching rule, cflags can appear only within condition:

  • In regular tables, inside condition-type fields.
  • In tree-structured data, inside __condition__ nodes.

Evaluating cflags yields a boolean value. The result is false only when cflags explicitly fail to satisfy the --cflags CLI flag. A ++ prefix overrides this: the result is true only when cflags explicitly satisfy --cflags.

--cflags not set --cflags match
(e.g. dev)
--cflags mismatch
(e.g. rel)
cflags not set true true true
cflags=dev,Tom true true false
cflags=++dev,Tom false true false

env yields a boolean value based on the specified environment variable when used in condition or superheader enabled.

Evaluating env@VAR looks up the environment variable VAR:

  • If unset, the expression yields false.
  • If set, the value must parse as a boolean; any other format results in an error.

For details on supported boolean formats, see the bool type.

Scope Order
Spreadsheet header #enabled → brace flags → xflags / tags / minver
Spreadsheet data #conditionswitch + case
Tree structure brace flags → xflags / tags / minver
Tree-structured data condition