From 9fe61b561f2d53b05eb70f9bc8d596251e154c08 Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Nov 29 2018 15:22:13 +0000 Subject: cli: document parse_arches method parameters Document the parameters for the parse_arches method. --- diff --git a/cli/koji_cli/lib.py b/cli/koji_cli/lib.py index 1f677d2..f05d5e1 100644 --- a/cli/koji_cli/lib.py +++ b/cli/koji_cli/lib.py @@ -141,8 +141,18 @@ def print_task_recurse(task,depth=0): def parse_arches(arches, to_list=False): - """Parse comma or space-separated list of arches and return - only space-separated one.""" + """Normalize user input for a list of arches. + + This method parses a single comma- or space-separated string of arches and + returns a space-separated string. + + :param str arches: comma- or space-separated string of arches, eg. + "x86_64,ppc64le", or "x86_64 ppc64le" + :param bool to_list: return a list of each arch, instead of a single + string. This is False by default. + :returns: a space-separated string like "x86_64 ppc64le", or a list like + ['x86_64', 'ppc64le']. + """ arches = arches.replace(',', ' ').split() if to_list: return arches