Edit File: cl_summary_arg_parse.cpython-37.pyc
B 5/9e� � @ sH d dl mZ d dlmZ d dlmZ d dlmZmZmZmZ dd� Z dS )� )�absolute_import)�docopt)� DocoptExit)�Schema�SchemaError�Or�Usec C s� d}d� |�}yt|| �}W n tk r8 d}d|fS X ttttttttttttttt�d�td� �}y|�|�}d}W n. t k r� } zt |�}d}W dd}~X Y nX ||fS )z Parse arguments for cloudlinux-summary command :param argv: sys.argv :return cortege: (error_flag, s_message) zcloudlinux-summarya� Utility to get Cloudlinux usage statistics Usage: {0} [--json] [--send] [--force-collect] [--lve-id <int>] [--async] {0} status [--json] {0} rpm-packages [--json] [--lve-id <int>] [--send] [--force-collect] {0} get-remote [--json] [--lve-id <int>] {0} enable [--json] [--lve-id <int>] {0} disable [--json] [--lve-id <int>] {0} enable-rpm [--json] {0} disable-rpm [--json] {0} (-h | --help) Options: --json Return data in JSON format. --send Send summary to the CloudLinux server --force-collect Ignore global settings.json when collecting statistics --lve-id <int> LVE for summary script. For internal use only. --async Start background process collecting statistics, return immediately -h, --help Show this help message and exit zERROR: Invalid parameter passedFN) z get-remotezrpm-packages�statusZenableZdisablez enable-rpmzdisable-rpmz--jsonz--sendz--force-collectz--helpz--lve-idz--asyncT)�formatr r r �boolr r �intZvalidater �str)�argvZ prog_nameZ docstring�argsZs_error_string�sr �e� r �$py/clsummary/cl_summary_arg_parse.py�parse_cloudlinux_summary_opts s8 r N) Z __future__r r r Zschemar r r r r r r r r �<module> s