From 702c5e78e9eb1f21c58149ae2cc0a4e5e3907db0 Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 5 Jul 2017 15:04:45 +0200 Subject: [PATCH] jp (common): fixed the use of --last-item when "-n [node]" is used --- frontends/src/jp/common.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontends/src/jp/common.py b/frontends/src/jp/common.py index ea060156..3c7d6570 100644 --- a/frontends/src/jp/common.py +++ b/frontends/src/jp/common.py @@ -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