File: utils.py

package info (click to toggle)
mycli 1.42.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,036 kB
  • sloc: python: 8,587; makefile: 10
file content (14 lines) | stat: -rw-r--r-- 298 bytes parent folder | download
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