﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
11590	REQUEST: Give LabelCommand an option for default behavior (when no labels are specified)	maaku	nobody	"The LabelCommand class is handy, but I've found circumstances where I need a default behavior when no labels are specified on the command line.  For example, when specifying directories os.getcwd() provides a reasonable default and a convenient shorthand.  Unless I missed something, implementing these commands required reimplementing LabelCommand.handle with the default hard coded in.  Obviously violates DRY.

Suggestion:
1. Add field ""default_label"" to LabelCommand with value ""None""
2. Switch (line 317-318 in django/trunk/django/core/management/base.py)

{{{
if not labels:
    raise CommandError('Enter at least one %s.' % self.label)
}}}

to

{{{
if not labels:
    if not self.default_label
        raise CommandError('Enter at least one %s.' % self.label)
    else:
        labels = [self.default_label]
}}}

or something similar.

Patch is attached."	New feature	closed	Core (Management commands)	dev	Normal	wontfix			Accepted	1	1	1	0	0	0
