Opened 9 years ago

Closed 9 months ago

Last modified 9 months ago

#6460 enhancement closed fixed (fixed)

twistd should print the subcommand name in its usage error messages

Reported by: Richard Wall Owned by: Heather White
Priority: normal Milestone:
Component: core Keywords: easy
Cc: Branch:
Author:

Description

Certain twistd usage errors can cause confusion because they don't print the name of the subcommand. eg

[richard@zorin ~]$ twistd -n procmon -n

/home/richard/projects/Twisted/trunk/bin/twistd: option -n not recognized

In this case -n is a valid twistd option but an invalid twistd procmon option.

Another good reason for printing the subcommand sequence is that the error line is often preceded by a full usage message which pushes the original command line off the page. Having the subcommand in the error message will make it obvious in cases where you typed an unintended (but valid) subcommand.

eg twistd mail_pop instead of twistd mail_imap (assuming for a moment that those two plugins existed).

Attachments (1)

twistd-subcommand-errors-6460.patch (1.2 KB) - added by Richard Wall 9 years ago.
An untested idea for a fix

Download all attachments as: .zip

Change History (10)

Changed 9 years ago by Richard Wall

An untested idea for a fix

comment:1 Changed 9 years ago by Richard Wall

Keywords: easy added

It should be quite easy to write a unit test for this and (if necessary) review and fix any existing unit tests that are broken by it.

comment:2 Changed 9 years ago by Arjun

Owner: set to Arjun
Status: newassigned

comment:3 Changed 11 months ago by Heather White

Keywords: review added
Owner: changed from Arjun to Heather White
Status: assignednew

comment:4 Changed 11 months ago by Glyph

Owner: Heather White deleted

comment:5 Changed 9 months ago by Wilfredo Sánchez Vega

Owner: set to Wilfredo Sánchez Vega
Status: newassigned

comment:6 Changed 9 months ago by Wilfredo Sánchez Vega

Owner: changed from Wilfredo Sánchez Vega to Heather White
Status: assignednew

comment:7 Changed 9 months ago by Wilfredo Sánchez Vega

Resolution: fixed
Status: newclosed

comment:9 Changed 9 months ago by Glyph

Keywords: review removed

(It's not in review now that it's merged.)

Note: See TracTickets for help on using tickets.