1
1
mirror of https://github.com/chubin/cheat.sh.git synced 2024-11-23 19:43:33 +03:00

add / to the section names in :list (fixes #73, fixes #77)

This commit is contained in:
Igor Chubin 2018-07-19 08:57:39 +00:00
parent 0bc55dfe99
commit e0fd79de4d

View File

@ -95,7 +95,7 @@ def _isdir(topic):
return os.path.isdir(topic)
def _get_answers_and_dirs():
topics = glob.glob(PATH_CHEAT_SHEETS + "*")
answer_dirs = [_remove_initial_underscore(os.path.split(topic)[1])
answer_dirs = [_remove_initial_underscore(os.path.split(topic)[1]).rstrip('/')+'/'
for topic in topics if _isdir(topic)]
answers = [os.path.split(topic)[1] for topic in topics if not _isdir(topic)]
return answer_dirs, answers