Skip to content

Cli Parser

Handsdown API Index / Handsdown / Cli Parser

Auto-generated documentation for handsdown.cli_parser module.

CLINamespace

Show source in cli_parser.py:22

Main CLI Namespace.

Signature

class CLINamespace:
    ...

CLINamespace().get_source_code_url

Show source in cli_parser.py:44

Get URL to source code.

Returns

URL as a string.

Signature

def get_source_code_url(self) -> str:
    ...

abs_path

Show source in cli_parser.py:93

Validate path_str and make it absolute.

Arguments

  • path_str - A path to check.

Returns

An absolute path.

Signature

def abs_path(path_str: str) -> Path:
    ...

dir_abs_path

Show source in cli_parser.py:106

Validate directory path_str and make it absolute.

Arguments

  • path_str - A path to check.

Returns

An absolute path.

Raises

  • argparse.ArgumentTypeError - If path is not a directory.

Signature

def dir_abs_path(path_str: str) -> Path:
    ...

existing_dir_abs_path

Show source in cli_parser.py:125

Validate existing directory path_str and make it absolute.

Arguments

  • path_str - A path to check.

Returns

An absolute path.

Raises

  • argparse.ArgumentTypeError - If path does not exist or is not a directory.

Signature

def existing_dir_abs_path(path_str: str) -> Path:
    ...

git_repo

Show source in cli_parser.py:65

Validate git_repo_url to be a GitHub repo and converts SSH urls to HTTPS.

Arguments

  • git_repo_url - GitHub URL or remote.origin.url

Returns

A GitHub URL.

Signature

def git_repo(git_repo_url: str) -> str:
    ...

parse_args

Show source in cli_parser.py:164

Get CLI arguments parser.

Returns

An argparse.ArgumentParser instance.

Signature

def parse_args(args: Iterable[str]) -> CLINamespace:
    ...

See also

parse_theme

Show source in cli_parser.py:146

Cast theme name to Theme.

Signature

def parse_theme(name: str) -> Theme:
    ...

See also