[pacman-dev] [PATCH 3/3] Improve --help switch output for pacman utils

Karol Blazewicz karol.blazewicz at gmail.com
Tue Jul 30 12:59:20 EDT 2013


On Tue, Jul 23, 2013 at 3:35 AM, Jason St. John <jstjohn at purdue.edu> wrote:
> On Tue, Jul 23, 2013 at 3:27 AM, Allan McRae <allan at archlinux.org> wrote:
>> On 22/07/13 11:09, Jason St. John wrote:
>>> Unify the formatting of the --help switch for pacman utils.
>>> All of the pacman utils will now output help text using the following
>>> format:
>>>
>>>   util-name (pacman) v<pacman version>
>>>
>>>   one line description of util's purpose
>>>
>>>   Usage: util-name [options]
>>>
>>>     -b, --bar      whatever --bar does
>>>     -f, --foo      whatever --foo does
>>>     -h, --help     display this help message
>>>
>>> Reported-by: Karol Błażewicz <karol.blazewicz at gmail.com>
>>> Signed-off-by: Jason St. John <jstjohn at purdue.edu>
>>> ---
>>> This commit should address the issues raised by Karol Błażewicz in this mail:
>>> https://mailman.archlinux.org/pipermail/pacman-dev/2013-June/017391.html
>>>
>>
>> Looks fine.   Query for everyone below:
>>
>>>  src/util/cleanupdelta.c |  9 ++++-----
>>>  src/util/pacsort.c      |  5 +++--
>>>  src/util/pactree.c      |  7 ++++---
>>>  src/util/testdb.c       | 12 +++++-------
>>>  src/util/testpkg.c      |  6 +++---
>>>  src/util/vercmp.c       | 17 +++++++++--------
>>>  6 files changed, 28 insertions(+), 28 deletions(-)
>>>
>>> diff --git a/src/util/cleanupdelta.c b/src/util/cleanupdelta.c
>>> index 4f34435..b13d770 100644
>>> --- a/src/util/cleanupdelta.c
>>> +++ b/src/util/cleanupdelta.c
>>> @@ -24,8 +24,6 @@
>>>  #include <alpm.h>
>>>  #include <alpm_list.h>
>>>
>>> -#define BASENAME "cleanupdelta"
>>> -
>>
>> It looks like we defined this in dea9b3bc when we stopped using basename
>> to output the program name.   Given it is only ever used in one place,
>> is there any reason to keep it?
>>
>>
>>
>
> In case it matters, I removed the BASENAME define for testdb, testpkg,
> and vercmp too.
>
> Jason
>

Sorry for a late response.

'pacman -h' still doesn't tell you what does it do.


$ testpkg
usage: testpkg <package file>
$ testpkg -h
Cannot find the given file

It would be nice if ' testpkg -h' printed help. If I'm reading
testpkg.c patch right, it doesn't fix this.


What about makepkg and other scripts? They're still missing a
description of what they do from 'foo -h':
$ head -3 /usr/bin/makepkg
#!/usr/bin/bash
#
#   makepkg - make packages compatible for use with pacman

$ head -3 /usr/bin/paclog-pkglist
#!/usr/bin/bash
#
# paclog-pkglist - Parse a log file into a list of currently installed packages

$ head -3 /usr/bin/pacman-db-upgrade
#!/usr/bin/bash -e
#
#   pacman-db-upgrade - upgrade the local pacman db to a newer format


More information about the pacman-dev mailing list