sanitycheck.pl needs to be more helpful when run at command line

RESOLVED FIXED in Bugzilla 3.2

Status

()

Bugzilla
Administration
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: cso, Assigned: cso)

Tracking

3.1.2
Bugzilla 3.2
Bug Flags:
approval +

Details

Attachments

(1 attachment, 1 obsolete attachment)

2.70 KB, patch
Frédéric Buclin
: review+
Details | Diff | Splinter Review
(Assignee)

Description

11 years ago
[colin@theta /var/www/htdocs/bugzilla-trunk $] perl sanitycheck.pl 
The name  is not a valid username.  
    Either you misspelled it, or the person has not
    registered for a Bugzilla account.

[colin@theta /var/www/htdocs/bugzilla-trunk $] perl sanitycheck.pl --help
Unknown option: help
The name  is not a valid username.  
    Either you misspelled it, or the person has not
    registered for a Bugzilla account.

It could be useful to provide a --help command, and possibly also provide the instruction in the error message.
(Assignee)

Comment 1

11 years ago
Created attachment 298017 [details] [diff] [review]
Patch to add a help command

Add a --help / -h command parameter for people to know what the script does.
Attachment #298017 - Flags: review?(LpSolit)

Comment 2

11 years ago
Comment on attachment 298017 [details] [diff] [review]
Patch to add a help command

>+my $help = 0; # Has user assked for help on this script?

s/assked/asked/


>+if ($help == 1)
>+{
>+	help() && exit();
>+}

Please use pod2usage(), see e.g. checksetup.pl and importxml.pl. Note that == 1 is not required. |if $help| will do it.


>+    print "  --verbose                Causes the script to be more\n";
>+    print "                           verbose in it's output\n";

s/it's/its/. Moreover, make it clear that --verbose will append *everything* in the email, why omitting it will only return errors.


>+    print "  --login <email address>  The user that is capable of running\n";
>+    print "                           a Sanity Check on the database\n";

Please specify that the user must have editcomponents privs and is the one who will get an email with the results returned by sanitycheck.cgi
Attachment #298017 - Flags: review?(LpSolit) → review-

Comment 3

11 years ago
Also, as soon as you converted the doc to POD, you can add sanitycheck.pl to docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm so that this script is listed in docs/html/api/index.html.
(Assignee)

Comment 4

11 years ago
Created attachment 300464 [details] [diff] [review]
Patch v2

Updated per the previous review.
Attachment #298017 - Attachment is obsolete: true
Attachment #300464 - Flags: review?(LpSolit)

Comment 5

11 years ago
Comment on attachment 300464 [details] [diff] [review]
Patch v2

r=LpSolit
Attachment #300464 - Flags: review?(LpSolit) → review+

Updated

11 years ago
Flags: approval+

Comment 6

11 years ago
Checking in sanitycheck.pl;
/cvsroot/mozilla/webtools/bugzilla/sanitycheck.pl,v  <--  sanitycheck.pl
new revision: 1.3; previous revision: 1.2
done
Checking in docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm;
/cvsroot/mozilla/webtools/bugzilla/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm,v  <--  Bugzilla.pm
new revision: 1.4; previous revision: 1.3
done
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.