Skip to content

Commit

Permalink
Mke2fs: handle the [options] stanza
Browse files Browse the repository at this point in the history
Handle the two documented tags of it.
  • Loading branch information
ptoscano committed Aug 16, 2019
1 parent a0be01e commit 82d0352
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
24 changes: 23 additions & 1 deletion lenses/mke2fs.aug
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,36 @@ let fs_types = IniFile.record fs_types_title
(fs_types_record | comment)


(************************************************************************
* Group: OPTIONS SECTION
*************************************************************************)

(* View: options_entries_int
Entries with an integer value *)
let options_entries_int = ("proceed_delay"|"sync_kludge")

(* View: options_entry
Possible entries under the <options> section *)
let options_entry = entry_sto options_entries_int Rx.integer

(* View: defaults_title
Title for the <options> section *)
let options_title = IniFile.title "options"

(* View: options
A options section *)
let options = IniFile.record options_title
((Util.indent . options_entry) | comment)


(************************************************************************
* Group: LENS AND FILTER
*************************************************************************)

(* View: lns
The mke2fs lens
*)
let lns = (empty|comment)* . (defaults|fs_types)*
let lns = (empty|comment)* . (defaults|fs_types|options)*

(* Variable: filter *)
let filter = incl "/etc/mke2fs.conf"
Expand Down
10 changes: 9 additions & 1 deletion lenses/tests/test_mke2fs.aug
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ module Test_mke2fs =
inode_ratio = 1048576
blocksize = -1
}

[options]
proceed_delay = 1
sync_kludge = 1
"

test Mke2fs.lns get conf =
Expand Down Expand Up @@ -74,7 +78,11 @@ module Test_mke2fs =
{ "inode_ratio" = "4096" } }
{ "filesystem" = "largefile"
{ "inode_ratio" = "1048576" }
{ "blocksize" = "-1" } } }
{ "blocksize" = "-1" } }
{} }
{ "options"
{ "proceed_delay" = "1" }
{ "sync_kludge" = "1" } }


test Mke2fs.common_entry
Expand Down

0 comments on commit 82d0352

Please sign in to comment.