jp (common): fixed the use of --last-item when "-n [node]" is used

This commit is contained in:
Goffi 2017-07-05 15:04:45 +02:00
commit 702c5e78e9

View file

@ -433,8 +433,11 @@ class BaseEdit(object):
else:
command = 'new'
if self.args.last_item and command != 'last':
self.parser.error(_(u"--last-item can't be used with a specified item"))
if self.args.last_item:
if pubsub_item is None:
command = 'last'
elif command != 'last':
self.parser.error(_(u"--last-item can't be used with a specified item"))
if not force_item and command in ('new', 'last', 'edit'):
# we need a temporary file