Closed Bug 413163 Opened 17 years ago Closed 16 years ago

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

Categories

(Bugzilla :: Administration, task)

3.1.2
task
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.2

People

(Reporter: cso, Assigned: cso)

Details

Attachments

(1 file, 1 obsolete file)

[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.
Attached patch Patch to add a help command (obsolete) — Splinter Review
Add a --help / -h command parameter for people to know what the script does.
Attachment #298017 - Flags: review?(LpSolit)
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-
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.
Attached patch Patch v2Splinter Review
Updated per the previous review.
Attachment #298017 - Attachment is obsolete: true
Attachment #300464 - Flags: review?(LpSolit)
Comment on attachment 300464 [details] [diff] [review]
Patch v2

r=LpSolit
Attachment #300464 - Flags: review?(LpSolit) → review+
Flags: approval+
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
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: