def app(): cli()
if __name__ == '__main__': from commands import cli cli(obj={})
import commands from dotenv import load_dotenv load_dotenv() commands.cli.add_command(commands.setup_command) commands.cli.add_command(commands.add_command) commands.cli.add_command(commands.list_command) commands.cli.add_command(commands.index_command) if __name__ == '__main__': commands.cli()
from commands import cli, setup, add, category_list, category from sys import argv from dotenv import load_dotenv load_dotenv() cli.add_command(setup) cli.add_command(add) cli.add_command(category_list) cli.add_command(category) if __name__ == '__main__': cli() """ if len(argv) == 2 and argv[1] == 'setup': ''' Initialize DataBase Usage: python main.py setup ''' setup() if len(argv) == 4 and argv[1] == 'add': ''' Adding new variable Usage: python main.py add --category-- http://google.com ''' add(category=argv[2], url=argv[3]) if len(argv) == 3 and argv[1] == 'category': ''' Search data by category Usage: python main.py catergory --category name--