From pbrezina at redhat.com Mon Nov 9 06:17:03 2015 Content-Type: multipart/mixed; boundary="===============3185458629652447996==" MIME-Version: 1.0 From: =?utf-8?q?Pavel_B=C5=99ezina_=3Cpbrezina_at_redhat=2Ecom=3E?= To: sssd-devel at lists.fedorahosted.org Subject: Re: [SSSD] [PATCH] sss_override: document --debug options Date: Fri, 28 Aug 2015 12:25:18 +0200 Message-ID: <55E0370E.4030201@redhat.com> In-Reply-To: 20150828102100.GI32704@mail.corp.redhat.com --===============3185458629652447996== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 08/28/2015 12:21 PM, Lukas Slebodnik wrote: > On (28/08/15 12:13), Pavel B=C5=99ezina wrote: >> On 08/27/2015 12:49 PM, Lukas Slebodnik wrote: >>> On (25/08/15 13:00), Pavel B=C5=99ezina wrote: >>>> https://fedorahosted.org/sssd/ticket/2758 >>> >>> >From f181b0a94863f082abaf074a0940e83fbf1c89b1 Mon Sep 17 00:00:00 2001 >>>> From: =3D?UTF-8?q?Pavel=3D20B=3DC5=3D99ezina?=3D >>>> Date: Tue, 25 Aug 2015 12:58:45 +0200 >>>> Subject: [PATCH] sss_override: document --debug options >>>> >>>> Resolves: >>>> https://fedorahosted.org/sssd/ticket/2758 >>>> --- >>>> src/man/sss_override.8.xml | 18 +++++++++++++++++- >>>> src/tools/common/sss_tools.c | 25 +++++++++++++++++++++---- >>>> 2 files changed, 38 insertions(+), 5 deletions(-) >>>> >>>> diff --git a/src/man/sss_override.8.xml b/src/man/sss_override.8.xml >>>> index d289f5b7dfa7fbd328831b4c71d45b4c555225cf..3db8cbe05322ddf662faaa= 4810cd3bf6b25f8883 100644 >>>> --- a/src/man/sss_override.8.xml >>>> +++ b/src/man/sss_override.8.xml >>>> @@ -38,7 +38,7 @@ >>>> all local overrides are lost. >>>> >>>> >>>> - >>>> + >>>> >>>> AVAILABLE COMMANDS >>>> >>>> @@ -189,6 +189,22 @@ >>>> >>>> >>>> >>>> + >>>> + >>>> + COMMON OPTIONS >>>> + >>>> + Those options are available with all commands. >>>> + >>>> + >>>> + >>>> + >>>> + , >>>> + LEVEL >>>> + >>>> + >>>> + >>>> + >>>> + >>>> >>>> >>>> >>>> diff --git a/src/tools/common/sss_tools.c b/src/tools/common/sss_tools= .c >>>> index 6bbce3a25ddddc0b23ebc108a917a38e94981b65..3e732a3411494262ea34a1= e5c332e86f5128e771 100644 >>>> --- a/src/tools/common/sss_tools.c >>>> +++ b/src/tools/common/sss_tools.c >>>> @@ -36,6 +36,13 @@ struct sss_cmdline { >>>> const char **argv; >>>> }; >>>> >>>> +static void sss_tool_print_common_opts(void) >>>> +{ >>>> + fprintf(stderr, _("Common options:\n")); >>>> + fprintf(stderr, " -d, --debug=3DINT %s\n", >>>> + _("Enable debug at level")); >>> NACK >>> This does not correspond with reality. The sort version does not work. >>> >>> It would be good to test own patches :-) >>> >>> [root(a)host ~]# sss_override -d=3D9 user-add >>> Usage: >>> sss_override COMMAND COMMAND-ARGS >>> >>> Available commands: >>> * user-add >>> * user-del >>> * group-add >>> * group-del >>> >>> [root(a)host ~]# sss_override --debug=3D2 user-add >>> Missing option: Specify name of modified object. >>> >>> Usage: sss_override user-add NAME [OPTIONS...] >>> -n, --name=3DSTRING Override name >>> -u, --uid=3DINT Override uid (non-zero value) >>> -g, --gid=3DINT Override gid (non-zero value) >>> -h, --home=3DSTRING Override home directory >>> -s, --shell=3DSTRING Override shell >>> -c, --gecos=3DSTRING Override gecos >>> >>> Help options: >>> -?, --help Show this help message >>> --usage Display brief usage message >>> (Thu Aug 27 12:32:49:273331 2015) [sssd] [parse_cmdline] (0x0020): Unab= le to parse command arguments >>> (Thu Aug 27 12:32:49:273461 2015) [sssd] [override_user_add] (0x0020): = Unable to parse command line. >>> >>> As you can see long version works. >> >> Thanks for this catch. >> >>> I would be also curious why you need to provide hacks >>> for printing argument description for autohelp. >>> There is a much more elegant way how to do it with libpopt. >>> (small hint POPT_ARGFLAG_DOC_HIDDEN in sss_tool_common_opts) >> >> Your curiosity is remarkable, though I have no idea why are you hinting = this >> flag. >> > because I cannot see a reason why we should > write tool tip with fprintf if > there is a way with libpopt. Because there is a way, but not an straight-forward and elegant way. = Since there is only one option and the list is not likely to be = extended, there is no problem with doing it this way. > It's not a NACK but I do not like your solution > so I will not ACK it either. You need to find someone else. I'm completely fine with this. > > LS > _______________________________________________ > sssd-devel mailing list > sssd-devel(a)lists.fedorahosted.org > https://lists.fedorahosted.org/mailman/listinfo/sssd-devel > --===============3185458629652447996==--