Commit ae117fe0 authored by Chris Lamb's avatar Chris Lamb 💬

diffoscope.main: Tidy ListToolsAction argparse action command.

parent e51e801c
...@@ -280,11 +280,12 @@ class ListToolsAction(argparse.Action): ...@@ -280,11 +280,12 @@ class ListToolsAction(argparse.Action):
print("External-Tools-Required: ", end='') print("External-Tools-Required: ", end='')
print(', '.join(sorted(tool_required.all))) print(', '.join(sorted(tool_required.all)))
current_os = get_current_os()
os_list = [current_os] if (current_os in OS_NAMES) else iter(OS_NAMES)
if os_override: if os_override:
os_list = [os_override] os_list = [os_override]
else:
current_os = get_current_os()
os_list = [current_os] if (current_os in OS_NAMES) else iter(OS_NAMES)
for os_ in os_list: for os_ in os_list:
tools = set() tools = set()
print("Available-in-{}-packages: ".format(OS_NAMES[os_]), end='') print("Available-in-{}-packages: ".format(OS_NAMES[os_]), end='')
...@@ -294,6 +295,7 @@ class ListToolsAction(argparse.Action): ...@@ -294,6 +295,7 @@ class ListToolsAction(argparse.Action):
except KeyError: except KeyError:
pass pass
print(', '.join(sorted(tools))) print(', '.join(sorted(tools)))
sys.exit(0) sys.exit(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment