Allow sleep states to be specified as S1, S2, ...

This is used by zzz(8).
This commit is contained in:
njl 2003-07-28 16:22:45 +00:00
parent 9bfbf98f8a
commit 1e480ac87f
2 changed files with 5 additions and 1 deletions

View File

@ -63,6 +63,7 @@ Recognized types are
and
.Cm 5
(soft off).
Sleep states may also be given as S1, S2, etc.
The supported states depend on BIOS implementation, including ACPI
byte code (AML).
.El

View File

@ -109,7 +109,10 @@ main(int argc, char *argv[])
break;
case 's':
sleep_type = optarg[0] - '0';
if (optarg[0] == 'S')
sleep_type = optarg[1] - '0';
else
sleep_type = optarg[0] - '0';
if (sleep_type < 0 || sleep_type > 5)
errx(EX_USAGE, "invalid sleep type (%d)",
sleep_type);