diff --git a/ls.py b/ls.py index 9d25c37..f6358a1 100755 --- a/ls.py +++ b/ls.py @@ -134,6 +134,12 @@ def git_gud(path): + + + + + + def list_files(directory='.', args={}): filenames = os.listdir(directory) @@ -201,7 +207,7 @@ def list_files(directory='.', args={}): #mtime = time.strftime("%b %d %X %Z", time.localtime(stats.st_mtime)) # CST colored_file = gen_color_file_string(file["abs_file_path"], file["stats"].st_mode) - gitstat = (args.extend and is_path_git_repo_dir(file["abs_file_path"], file["stats"].st_mode) and git_gud(file["abs_file_path"])) or '' + gitstat = git_gud(file["abs_file_path"]) if (args.extend and is_path_git_repo_dir(file["abs_file_path"], file["stats"].st_mode)) else '' ## do printing print(f"{perm_prettybits} {nlinks:2d} {user:<8s} {group:<8s} {size:>{longest_size_length}} {timestring} {colored_file} {gitstat}") @@ -212,6 +218,9 @@ def list_files(directory='.', args={}): + + + if __name__ == "__main__": parser = argparse.ArgumentParser(description="List files in a directory", add_help=False) parser.add_argument('directory', nargs='?', default='.', help="Directory path")