<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cli(ctx, packages, all, list, platform):
 """Uninstall packages."""


    if packages:
        _uninstall(packages, platform)
    elif all:  # pragma: no cover
        packages = Resources(platform).packages
        _uninstall(packages, platform)
    elif list:
        Resources(platform).list_packages(installed=True, notinstalled=False)
    else:
        click.secho(ctx.get_help())