File: cmd_list.py

package info (click to toggle)
python-keep 2.11-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 184 kB
  • sloc: python: 542; sh: 25; makefile: 3
file content (14 lines) | stat: -rw-r--r-- 411 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import os
import click
from keep import cli, utils


@click.command('list', short_help='Shows the saved commands.')
@cli.pass_context
def cli(ctx):
    """Shows the saved commands."""
    json_path = os.path.join(os.path.expanduser('~'), '.keep', 'commands.json')
    if not os.path.exists(json_path):
        click.echo('No commands to show. Add one by `keep new`.')
    else:
        utils.list_commands(ctx)