On Wed Mar 20, 2024 at 1:45 PM CET, Wolfgang Bumiller wrote:
> On Tue, Mar 19, 2024 at 04:32:49PM +0100, Max Carrara wrote:
> > +@contextmanager
> > +def connect_to_esxi_host(args: EsxiConnectonArgs) -> vim.ServiceInstance:
> > +"""Opens a connection to an ESXi host with the given username and
On Tue, Mar 19, 2024 at 04:32:49PM +0100, Max Carrara wrote:
> +@contextmanager
> +def connect_to_esxi_host(args: EsxiConnectonArgs) -> vim.ServiceInstance:
> +"""Opens a connection to an ESXi host with the given username and
> password
> +contained in the password file.
> +"""
> +
On Wed Mar 20, 2024 at 10:39 AM CET, Lukas Wagner wrote:
>
>
> On 2024-03-19 16:32, Max Carrara wrote:
>
> > +def _squeeze_and_wrap(text: str) -> str:
> > +"""Makes it easier to write help text using multiline strings."""
> > +
> > +text = text.replace("\n", " ").strip()
> > +
On 2024-03-19 16:32, Max Carrara wrote:
> +def _squeeze_and_wrap(text: str) -> str:
> +"""Makes it easier to write help text using multiline strings."""
> +
> +text = text.replace("\n", " ").strip()
> +
> +# squeeze recurring spaces
> +while " " in text:
>
In order to make the CLI interface more friendly to humans, Python's
`argparse` [0] module from the standard library is used to parse the
arguments provided to the script. Each option and positional argument
also contain a short help text that is shown when running the script
with either "-h" or