Skip to content

iseewhatyoudid ¤

iseewhatyoudid package.

Overview of what you achieved.

Functions:

  • get_parser –

    Return the CLI argument parser.

  • main –

    Run the main program.

get_parser ¤

get_parser() -> ArgumentParser

Return the CLI argument parser.

Returns:

Source code in src/iseewhatyoudid/_internal/cli.py
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
def get_parser() -> argparse.ArgumentParser:
    """Return the CLI argument parser.

    Returns:
        An argparse parser.
    """
    parser = argparse.ArgumentParser(prog="iseewhatyoudid")
    parser.add_argument(
        "-V",
        "--version",
        action="version",
        version=f"%(prog)s {debug._get_version()}",
    )
    parser.add_argument(
        "--debug-info",
        action=_DebugInfo,
        help="Print debug information.",
    )
    subparsers = parser.add_subparsers(dest="command")
    dashboard = subparsers.add_parser(
        "dashboard",
        help="Display your GitHub activity dashboard.",
    )
    _add_dashboard_arguments(dashboard)
    return parser

main ¤

main(args: list[str] | None = None) -> int

Run the main program.

This function is executed when you type iseewhatyoudid or python -m iseewhatyoudid.

Parameters:

  • args ¤

    (list[str] | None, default: None ) –

    Arguments passed from the command line.

Returns:

  • int –

    An exit code.

Source code in src/iseewhatyoudid/_internal/cli.py
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
def main(args: list[str] | None = None) -> int:
    """Run the main program.

    This function is executed when you type `iseewhatyoudid` or `python -m iseewhatyoudid`.

    Parameters:
        args: Arguments passed from the command line.

    Returns:
        An exit code.
    """
    parser = get_parser()
    opts = parser.parse_args(args=args)
    if not opts.command:
        parser.print_help()
        return 0

    if opts.command == "dashboard":
        return _run_dashboard(opts)

    parser.print_help()
    return 0