Code

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7972 closed (invalid)

allow argv options anywhere on command line

Reported by: mukappa Owned by: nobody
Component: Core (Management commands) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I don't like having to remember exactly where --settings=xxx goes.

Attachments (1)

argvorder.diff (2.8 KB) - added by mukappa 6 years ago.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by mukappa

comment:1 Changed 6 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

I don't like bug reports that don't explain what the problem is.

comment:2 Changed 6 years ago by mukappa

from http://www.python.org/doc/2.5.2/lib/module-optparse.html the following command lines are all equivalent

<yourscript> -f outfile --quiet
<yourscript> --quiet --file outfile
<yourscript> -q -foutfile
<yourscript> -qfoutfile

I think that implies

$ python manage.py --settings=settings shell

and

$ python manage.py shell --settings=settings

are equivalent.

but for manage.py (and django-admin.py)

$ python manage.py --settings=settings shell
Unknown command: '--settings=settings'

manage.py cares where its options are, but I don't see where it needs to. I sometimes put an option in the "wrong" place and find it frustrating to have to check the usage.

Thanks.

comment:3 Changed 6 years ago by mukappa

Sorry, my brain saw what it wanted to see, not what was there in the excerpt from the optparse doc.

Nonetheless, optparse allows mixing options anywhere between and around args, and I'll leave it at that.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.