File: __main__.py

package info (click to toggle)
python-poetry-dynamic-versioning 1.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 460 kB
  • sloc: python: 1,528; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 475 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import sys

from poetry_dynamic_versioning import (
    _state,
    cli,
)


def main() -> None:
    try:
        _state.cli_mode = True
        args = cli.parse_args()

        if args.cmd is None:
            cli.apply(standalone=True)
        elif args.cmd == cli.Command.enable:
            cli.enable()
        elif args.cmd == cli.Command.show:
            cli.show()
    except Exception as e:
        print("Error: {}".format(e), file=sys.stderr)
        sys.exit(1)