Renamed --session-read to --session-read-only.

This commit is contained in:
Jakub Roztocil 2012-09-17 00:01:49 +02:00
parent 66bdbc3745
commit 478d654945
3 changed files with 9 additions and 6 deletions

View File

@ -528,8 +528,9 @@ To switch to another session simple pass a different name:
$ http --session user2 -a user2:password example.org X-Bar:Foo
To use an existing session without updating it from the request/response
exchange, specify the session via ``--session-read=SESSION_NAME`` instead.
To use a session without updating it from the request/response exchange
once it is created, specify the session name via
``--session-read-only=SESSION_NAME`` instead.
You can view and manipulate existing sessions via the ``httpie`` management
command, see ``httpie --help``.

View File

@ -235,8 +235,10 @@ sessions.add_argument(
''')
)
sessions.add_argument(
'--session-read', metavar='SESSION_NAME',
help=_('''Create or reuse a session, but do not update it once saved.''')
'--session-read-only', metavar='SESSION_NAME',
help=_('''
Create or reuse a session, but do not update it once saved.
''')
)

View File

@ -28,9 +28,9 @@ def get_response(args):
return requests.request(**requests_kwargs)
else:
return sessions.get_response(
name=args.session or args.session_read,
name=args.session or args.session_read_only,
request_kwargs=requests_kwargs,
read_only=bool(args.session_read),
read_only=bool(args.session_read_only),
)