From 7fa8bdb6f93ae451095da54d535e5dd89e12b339 Mon Sep 17 00:00:00 2001 From: zlaxy Date: Wed, 22 Sep 2021 18:19:17 +0300 Subject: [PATCH] Fix -f cmd output --- sshch/sshch | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sshch/sshch b/sshch/sshch index cc36b45..f87c6f5 100755 --- a/sshch/sshch +++ b/sshch/sshch @@ -20,7 +20,7 @@ import curses from curses import textpad, panel # https://gitlab.com/zlax/sshch -version = "1.07" +version = "1.08" # expand groups by default expand_default = True # path to conf dir and file, default: ~/.config/sshch.conf @@ -285,14 +285,10 @@ def GroupTreeRecursion(level, group, treelist, resultalias, resultstring, expand return resultalias, resultstring previousgroups.append(group) resultalias.append(group) - if group in expandlist: - resultstring.append(' '*(level-1)+">> "+group) - else: - resultstring.append(' '*(level-1)+"<> "+group) if expandlist == True or group in expandlist: + resultstring.append(' '*(level-1)+">> "+group) for g in treelist[group].children: resultalias, resultstring = GroupTreeRecursion(level+1, g, treelist, resultalias, resultstring, expandlist, previousgroups) - if expandlist == True or group in expandlist: for ga in treelist[group].aliases: if conf.has_option(ga, "exec_string"): resultalias.append(ga) @@ -300,6 +296,8 @@ def GroupTreeRecursion(level, group, treelist, resultalias, resultstring, expand conf.has_option(ga, "exec_string") else ""), ")", (" [password]" if conf.has_option(ga, "password") else "")]) resultstring.append(result) + else: + resultstring.append(' '*(level-1)+"<> "+group) return resultalias, resultstring