Skip to content

Commit 579a54b

Browse files
committed
Exit code 1 when multiple --show entries are returned
1 parent 5228919 commit 579a54b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

keepmenu/__main__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import socket
1515
import string
1616
from subprocess import call
17+
import sys
1718

1819
import keepmenu
1920
from keepmenu.keepmenu import DmenuRunner
@@ -294,7 +295,8 @@ def main():
294295
password = run_once(**args)
295296
if password:
296297
print(password)
297-
return
298+
return
299+
sys.exit(1)
298300
try:
299301
manager = client(port, auth)
300302
conn = manager.get_pipe() # pylint: disable=no-member
@@ -328,6 +330,7 @@ def main():
328330
if result:
329331
if result.startswith("ERROR:"):
330332
print(result[7:], file=sys.stderr) # Strip "ERROR: " prefix
333+
sys.exit(1)
331334
else:
332335
print(result)
333336
except ConnectionRefusedError:

0 commit comments

Comments
 (0)