From de6dd4a99198cdeae28521a8ddec951deb089653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Fri, 16 Oct 2015 23:02:46 +0200 Subject: [PATCH] Align package names in selection --- agetpkg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/agetpkg b/agetpkg index 823cff0..1a85dc9 100755 --- a/agetpkg +++ b/agetpkg @@ -282,8 +282,9 @@ def select_packages(packages): else: # display a list of packages to select index = dict(enumerate(packages)) + pad = len("%d" % max(index.keys())) for i, pkg in index.items(): - print(i, pkg) + print("{:{pad}} {}".format(i, pkg, pad=pad)) selection = "" while not match("^(\d+ ){0,}\d+$", selection): selection = input("Select packages: ").strip() -- GitLab