--- augeas-1.1.0/lenses/interfaces.aug +++ augeas-1.1.0.iface/lenses/interfaces.aug @@ -36,21 +36,26 @@ let stanza_id (t:string) = key t . sep_spc . sto_to_spc let stanza_param (l:string) = [ sep_spc . label l . sto_to_spc ] -(* Define reseverved words *) -let stanza_word = /(iface|auto|allow-[a-z-]+|mapping)/ +(* Define reseverved words and multi-value options*) +let stanza_word = /(iface|auto|allow-[a-z-]+|mapping|bond-slaves|bridge-ports)/ +(* Define stanza option indentation *) +let stanza_indent = del /[ \t]*/ " " + (* Define additional lines for multi-line stanzas *) -let stanza_option = [ del /[ \t]*/ " " +let stanza_option = [ stanza_indent . key ( /[a-z_-]+/ - stanza_word ) . sep_spc . sto_to_eol ] +(* Define space-separated array *) +let array (r:regexp) (t:string) = del r t . label t . counter t + . [ sep_spc . seq t . sto_to_spc ]+ + (************************************************************************ * AUTO *************************************************************************) -let array (r:regexp) (t:string) = del r t . label t . counter t - . [ sep_spc . seq t . sto_to_spc ]+ let auto = [ array /(allow-)?auto/ "auto" . eol ] (************************************************************************ @@ -74,12 +79,18 @@ * IFACE *************************************************************************) +let multi_option (t:string) = [ stanza_indent . array t t . eol ] + let iface = [ Util.indent . stanza_id "iface" . stanza_param "family" . stanza_param "method" . eol - . (stanza_option|comment|empty)* ] + . ( stanza_option + | multi_option "bond-slaves" + | multi_option "bridge-ports" + | comment + | empty )* ] (************************************************************************ * STANZAS