File: utils.py

package info (click to toggle)
mycli 1.44.1-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 1,048 kB
  • sloc: python: 9,087; makefile: 10
file content (14 lines) | stat: -rw-r--r-- 298 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# type: ignore

import shlex


def parse_cli_args_to_dict(cli_args: str):
    args_dict = {}
    for arg in shlex.split(cli_args):
        if "=" in arg:
            key, value = arg.split("=")
            args_dict[key] = value
        else:
            args_dict[arg] = None
    return args_dict