zsh-syntax-highlighting icon indicating copy to clipboard operation
zsh-syntax-highlighting copied to clipboard

main: Add systemd run0 equivalent to sudo

Open ColinKinloch opened this issue 1 year ago • 4 comments

~I suspect these changes are incorrect or incomplete. Is the second value a list of single letter flags arguments? Should it be Cgprtu:AEHPSbilns:eKkVv?~ run0 is a systemd 256 alternative to sudo.

ColinKinloch avatar Sep 23 '24 17:09 ColinKinloch

Is the second value a list of single letter flags arguments?

The middle value is list of single-letter flags that don't take arguments. E.g., 'sudo -u foo' uses 'foo' as an argument to '-u', so sudo's "u" is before the first colon; but 'sudo -l foo' interprets 'foo' as a positional argument, hence sudo's '-l' is in the middle group.

Lines 35 through 337 were supposed to make this clear, but there's room for improvement.

danielshahaf avatar Sep 23 '24 21:09 danielshahaf

That makes sense, thanks. In that case the only options are ugD each taking an argument. And -h which seems to be intentionally omitted.

ColinKinloch avatar Sep 23 '24 21:09 ColinKinloch

And -h which seems to be intentionally omitted.

I do see a -h in https://man.archlinux.org/man/run0.1.en.

Could you add a comment stating the run0 version referenced? That's helpful down the road when looking for what flags were added/changed (we can just go through the upstream changelog, or diff upstream's man page source between tags).

Other than that, LGTM, but I'll defer to others to do the actual merge.

danielshahaf avatar Sep 25 '24 06:09 danielshahaf

I do see a -h in https://man.archlinux.org/man/run0.1.en.

Ah, never mind. I was confused by the absence of h in sudo. having an option switch meanings seems like a bad idea :thinking: .

I've added h and noted that it's systemd 256.6

ColinKinloch avatar Sep 25 '24 11:09 ColinKinloch