<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 3, 2014 at 8:31 PM, tito <span dir="ltr"><<a href="mailto:farmatito@tiscali.it" target="_blank">farmatito@tiscali.it</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thursday 03 July 2014 14:51:11 you wrote:<br>
> On Thu, Jul 3, 2014 at 12:59 PM, tito <<a href="mailto:farmatito@tiscali.it">farmatito@tiscali.it</a>> wrote:<br>
><br>
> > On Thursday 03 July 2014 13:03:46 Laszlo Papp wrote:<br>
> > > On Thu, Jul 3, 2014 at 11:10 AM, Laszlo Papp <<a href="mailto:lpapp@kde.org">lpapp@kde.org</a>> wrote:<br>
> > ><br>
> > > > commit 761fd153e340a14abccc0af89f2f6617faf2077f<br>
> > > > Author: Laszlo Papp <<a href="mailto:lpapp@kde.org">lpapp@kde.org</a>><br>
> > > > Date:   Thu Jul 3 11:06:58 2014 +0100<br>
> > > ><br>
> > > >     Add optional home directory removal support to deluser<br>
> > > ><br>
> > > > diff --git a/loginutils/deluser.c b/loginutils/deluser.c<br>
> > > > index e39ac55..67b744b 100644<br>
> > > > --- a/loginutils/deluser.c<br>
> > > > +++ b/loginutils/deluser.c<br>
> > > > @@ -11,9 +11,10 @@<br>
> > > >   */<br>
> > > ><br>
> > > >  //usage:#define deluser_trivial_usage<br>
> > > > -//usage:       "USER"<br>
> > > > +//usage:       "[-h] USER"<br>
> > > >  //usage:#define deluser_full_usage "\n\n"<br>
> > > >  //usage:       "Delete USER from the system"<br>
> > > > +//usage:       "\n    -h   Remove the home directory"<br>
> > > ><br>
> > > >  //usage:#define delgroup_trivial_usage<br>
> > > >  //usage:       IF_FEATURE_DEL_USER_FROM_GROUP("[USER] ")"GROUP"<br>
> > > > @@ -35,11 +36,15 @@ int deluser_main(int argc, char **argv)<br>
> > > >         /* Name of shadow or gshadow file */<br>
> > > >         const char *sfile;<br>
> > > >         /* Are we deluser or delgroup? */<br>
> > > > +    struct passwd *pw = 0;<br>
> > > ><br>
> > ><br>
> > > This could probably be one line below not to distract the comment and<br>
> > > corresponding variable declaration. Although, ideally, this would need to<br>
> > > go to the "case 2" branch, but I did not want to introduce a new block<br>
> > > there with re-indenting many lines. Also, do you prefer "NULL" instead of<br>
> > > "0"?<br>
> > ><br>
> > > Let me know what the preferred style is...<br>
> > ><br>
> > > The patch is tested with and without "-h" and it works. The option<br>
> > > selection is "-h" which reminds some people the canonical "help", but on<br>
> > > the contrary, this is also what is used for adduser to create the home<br>
> > > directory, so I picked it up for being consistent. Again, let me know<br>
> > your<br>
> > > preference ...<br>
> > ><br>
> ><br>
> > Hi,<br>
> > couldn't we change -h as it conflicts with -h/--help and use -r as in<br>
> > --remove-home:<br>
> ><br>
><br>
> Well, I prefer consistency, otherwise it will become to effectively use the<br>
> applets. After all, if you do not type anything, you will get the help<br>
> output, or misuse it, so why would we bloat the applet code with that?<br>
><br>
<br>
</div></div>Hi,<br>
where is the bloat in doing:<br>
<div class=""><br>
 //usage:#define deluser_trivial_usage<br>
-//usage:       "USER"<br>
</div>+//usage:       "[-r] USER"<br>
<div class=""> //usage:#define deluser_full_usage "\n\n"<br>
 //usage:       "Delete USER from the system"<br>
</div>+//usage:       "\n    -r   Remove the home directory"<br></blockquote><div><br></div><div>That does not make sense to me, I am afraid. It might be possible later to remove other config data, too. It is probably not acceptable, thus it is not done so even on desktop.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

and<br>
<br>
    int do_delhome = 0;<br>
<div class="">    if (getopt32(argv, "r") & 1) { ++argv; --argc; do_delhome = 1; }<br>
<br>
</div>or maybe simply:<br>
<br>
    int do_delhome = getopt32(argv, "r"):<br>
    argc -= optind;<br>
    argv += optind;<br></blockquote><div><br></div><div>This looks worse than a simple increment to me, but it is such a minor detail that I do not think it is too relevant.<br><br></div><div>-h is nice and consistent. I do not know why you would want help option two when it only has one option. You would double the option number. It would be an overkill in this case.<br>
<br>By the way, I like the bikeshed pink. ;-)<br></div></div></div></div>