-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzap_cli.py
executable file
·50 lines (41 loc) · 1.38 KB
/
zap_cli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python3
# import click library
import click
# import modules from commands directory
from commands import calculator
from commands import note_app
from commands import yt_dl
from commands import gen_pass
from commands import unit
from commands import expense
from commands import sysinfo
from commands import cache
from commands import image_processor
# define main command group for the CLI Tool
@click.group(help="ZAP CLI tool:A command-line interface for various utilities.")
def cli():
"""Main entry point for ZAP CLI Tool."""
# function doesn't do anything.
# is REQUIRED for defining the command group
pass
"""
Adds command groups to the `cli` group.
Each command group is a separate subcommand namespace.
The first part is the module and the second part specifies the command to be added.
"""
# example
# adding the 'calculator' command group to the CLI
# `calculator.calculator` refers to the `calculator` module's `calculator` command group
cli.add_command(calculator.calculator)
cli.add_command(note_app.note_app)
cli.add_command(yt_dl.yt_dl)
cli.add_command(gen_pass.gen_pass)
cli.add_command(unit.unit)
cli.add_command(expense.expense)
cli.add_command(sysinfo.sysinfo)
cli.add_command(cache.cache)
cli.add_command(image_processor.image_processor)
# Entry point of the script.
# Calls the CLI tool if the script is executed.
if __name__ == "__main__":
cli()