On 2015-01-19, Remco <[email protected]> wrote:

>> OpenBSD
>> # shutdown -ph 1501161730
>> 
>> other BSDs
>> # shutdown -p 1501161730
>
> It makes sense to me to imply -h when specifying -p.

I'd love it, but for all I know somebody may have a strong opinion
against it.

On the one hand, "shutdown -hp" is inconsistent because we don't
have "shutdown -hr" either.  On the other hand, "-hp" mirrors
"halt -p".

> --- shutdown.c        16 Jan 2015 06:40:01 -0000      1.38
> +++ shutdown.c        19 Jan 2015 12:03:03 -0000
> @@ -134,6 +134,7 @@ main(int argc, char *argv[])
>                       nosync = 1;
>                       break;
>               case 'p':
> +                     dohalt = 1;
>                       dopower = 1;
>                       break;
>               case 'r':

I don't like this.  Instead, all the places that handle dohalt and
doreboot should be extended with dopower; see the FreeBSD code.

-- 
Christian "naddy" Weisgerber                          [email protected]

Reply via email to