/**
 * File:
 *   run_parted_check.scr
 * Summary:
 *   SCR Agent for reading the result from "parted -s $1 resize 1 0 36"
 * Access:
 *   read-only
 * Authors:
 *   Unknown <yast2-hacker@suse.de>
 * See:
 *   anyagent
 *   libscr
 *   man parted
 * Example:
 *   Read(.parted.check)
 *   ($["need":30,
 *      "have":23
 *   ])
 * 
 * Runs
 * $Id: parted_check.scr 13018 2003-12-11 12:52:53Z jhumpol $
 *
 * Returns a <b>map</b> with two keys (if successful):
 * "need": the needed free space, and
 * "have": the amount of free space available
 */
.parted.check

`ag_anyagent(
  `Description (
    (`Run("/usr/sbin/parted -s ", `arg(0), " resize 1 0 36")),
    "\n", true,
    (`Tuple (
      `Choice (
	[`Sequence ("No Implementation", `String("^\n")), 0],
	["Error: You need ",
		 `Sequence (`need(`Number()),
			   "M of free space to shrink this partition to this size (you")
	],
	["currently have only ",
		 `Sequence (`have(`Number()), "M free)")
	]
      ),
      `Continue ("\n")
    ))
  )
)
