From 12d0340af8a519cbb153614d25bb9ccf6a60a66c Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Sat, 6 Mar 2010 13:30:32 +0100 Subject: [PATCH] Fix displaying help of keyword options. --- patoolib/baker.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/patoolib/baker.py b/patoolib/baker.py index ce9b8a7..2994986 100644 --- a/patoolib/baker.py +++ b/patoolib/baker.py @@ -287,13 +287,12 @@ class Baker(object): file.write(format_paras(paras[1:], 76, indent=4)) file.write("\n") + # Get a sorted list of keyword argument names + keynames = sorted([key for key, value in cmd.keywords.items() if value is not None]) # Print documentation for keyword options - if cmd.keywords: + if keynames: file.write("Options:\n\n") - # Get a sorted list of keyword argument names - keynames = sorted(cmd.keywords.keys()) - # Make formatted headings, e.g. " -k --keyword ", and put them in # a list like [(name, heading), ...] heads = []