Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#40573 - [pkgbuild-introspection] Suggestion: add more variants of "-h" (or a man page)

Attached to Project: Community Packages
Opened by Steven Honeyman (stevenhoneyman) - Tuesday, 27 May 2014, 18:53 GMT
Last edited by Dave Reisner (falconindy) - Wednesday, 28 May 2014, 18:58 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Lukas Fleischer (lfleischer)
Dave Reisner (falconindy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

I just received the notification regarding AUR3 and the need for packaging using this tool. I had to skim through the source to find out what the command for help was!
"--help" usually works on most programs, or the man page would tell you more about it.

My usual attempts would be: --help, -help, (no params), -?, --?

I guess also that the first thing should be output the help if ./PKGBUILD doesn't exist (instead of an error)

Steps to reproduce:

$ mkaurball --help
ERROR: invalid option -- '-'
$ mkaurball
/usr/bin/mkaurball: line 230: ./PKGBUILD: No such file or directory
This task depends upon

Closed by  Dave Reisner (falconindy)
Wednesday, 28 May 2014, 18:58 GMT
Reason for closing:  Upstream
Additional comments about closing:  https://github.com/falconindy/pkgbuild-i ntrospection/commit/89335c40
Comment by Dave Reisner (falconindy) - Wednesday, 28 May 2014, 04:57 GMT
Sorry, it doesn't make sense to me that you'd try unusual options like -? or --? before -h. I'd never expect '-help' to mean what you're implying it means, either. I'm really not interested in adding longopts to such a simple program. If you'd like a contribute a manpage, I'll gladly take pull requests on github.
Comment by Steven Honeyman (stevenhoneyman) - Wednesday, 28 May 2014, 16:59 GMT
It doesn't have to make sense to you why I'd try those 5 attempts, but your script should be able to cope with it regardless (the -? is due to working with Windows servers/PCs as a day job by the way, force of habit I guess!)

Want some suggestions on how you could implement this improvement without having to change much?

1) grep for "help" on the input ==> display help
2) if the "option" is '-' ==> display help
3) if ./PKGBUILD doesnt exist ==> display help

any/all of those would solve most efforts to get information out of your script, and are all 1-liners.
Comment by Dave Reisner (falconindy) - Wednesday, 28 May 2014, 17:02 GMT
> It doesn't have to make sense to you why I'd try those 5 attempts,
Extrapolating out that logic, everything that isn't a valid option or expected usage should result in the help being displayed. Not a pattern I'm fond of.
Comment by Steven Honeyman (stevenhoneyman) - Wednesday, 28 May 2014, 17:04 GMT
Agree with the logic, isn't that how pretty much every other piece of software is written though?

$ ls -asdfghjkl
ls: invalid option -- 'j'
Try 'ls --help' for more information.
$

Loading...