/**
 * File:
 *   run_parted_print.scr
 * Summary:
 *   SCR Agent for reading the result from "parted -s /dev/??? print"
 * Access:
 *   read-only
 * Authors:
 *   Unknown <yast2-hacker@suse.de>
 * See:
 *   anyagent
 *   libscr
 *   man parted
 * Example:
 *   Read(.parted.print)
 *   ($["1":$["end":"23.532", 
 *            "filesystem":"ext2", 
 *            "flags":"boot", 
 *            "start":"0.031", 
 *            "type":"primary"], 
 *      "2":$["end":"282.392", 
 *            "filesystem":"linux-swap", 
 *            "start":"23.533", 
 *            "type":"primary"], 
 *      "3":$["end":"8746.325", 
 *            "filesystem":"reiserfs", 
 *            "start":"282.393", 
 *            "type":"primary"]
 *   ])
 *
 * $Id: parted_print.scr 13018 2003-12-11 12:52:53Z jhumpol $
 *
 * Returns a <b>map</b>. Keys are Partition number. 
 * Values are maps, that contain infromation on the partition. 
 * Valid keys for these maps are: "start", "end", "type", "filesystem" , "flags"
 */
.parted.print

`ag_anyagent(
  `Description (
  (`Run("/usr/sbin/parted -s ", `arg(0), " print")),
  "\n", true,
  (`Tuple (
      `Choice (
	[`Name(`Number()), `Value(`Tuple(
		 `Whitespace(),
		`start(`String("^ \t")),
		 `Whitespace(),
		`end(`String("^ \t")),
		 `Whitespace(),
		`type(`String("^ \t\n")),
		 `Optional (`Whitespace()),
		 `Optional (`filesystem(`String("^ \t\n"))),
		 `Optional (`Whitespace()),
		 `Optional (`flags(`String("^\n"))),
		 `Optional(`String("^\n"))
		))
	],
	[`String("^\n"), `Skip ()]
      ),
      `Continue ("\n")
  ))
  )
)
