Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: issue with usermod command completion



On 7/23/19 11:04 PM, hottea wrote:
> Hi,
> usermode [TAB] gives me:
> usermod --add-sub-
> --add-sub-gids  -- add a range of subordinate gids
> --add-sub-uids  -- add a range of subordinate uids
>
> However, there's no --add-sub-gids or --add-sub-uids options. I think
> they're typo of --add-subgids and --add-subuids.
>
> After checking the source, a modification might be needed in these
> lines: https://github.com/zsh-users/zsh/blob/master/Completion/Unix/Command/_user_admin#L106-L109
>

seemed to have been based off of a man page at the time: http://manpages.ubuntu.com/manpages/xenial/man8/usermod.8.html
curious though, looking at the source code of the package for the same release, the option seemed to have always been --{add,del}-sub{g,u}ids.
so a typo in the documentation causing us to incorrectly add it that way. regardless


diff --git a/Completion/Unix/Command/_user_admin b/Completion/Unix/Command/_user_admin
index fe28c13f5..c7e1efc80 100644
--- a/Completion/Unix/Command/_user_admin
+++ b/Completion/Unix/Command/_user_admin
@@ -103,10 +103,10 @@ case ${service%???}:${(M)service%???}:$OSTYPE in
   user:mod:linux*)
     args+=(
       '(-a --append)'{-a,--append}'[add user to supplementary groups without removing from other groups]'
-      \*{-v,--add-sub-uids}'[add a range of subordinate uids]:uids (first-last)'
-      \*{-V,--del-sub-uids}'[remove a range of subordinate uids]:uids (first-last)'
-      \*{-w,--add-sub-gids}'[add a range of subordinate gids]:gids (first-last)'
-      \*{-W,--del-sub-gids}'[remove a range of subordinate gids]:gids (first-last)'
+      \*{-v,--add-subuids}'[add a range of subordinate uids]:uids (first-last)'
+      \*{-V,--del-subuids}'[remove a range of subordinate uids]:uids (first-last)'
+      \*{-w,--add-subgids}'[add a range of subordinate gids]:gids (first-last)'
+      \*{-W,--del-subgids}'[remove a range of subordinate gids]:gids (first-last)'
     )
   ;|
   user:mod:*)



Messages sorted by: Reverse Date, Date, Thread, Author