o
    qiF                     @   sf   d Z ddlZddlmZmZ ddlZejeje	Z
dZG dd dejZejeddd	 ZdS )
zEntry point for cli    N)AnyListcmd_c                   @   s8   e Zd ZdZdedefddZdededefddZd	S )
CLIz Main class for handling commandsctxreturnc                 C   sF   g }t tD ]}|dr|tr||dd  q|  |S )z
         Obtain a list of all available commands.
        Args:
            ctx (Any): Click context
        Returns:
            (List) List of sorted commands
        .py   )oslistdir
CMD_FOLDERendswith
startswith
CMD_PREFIXappendsort)selfr   commandsfilename r   H/home/ubuntu/.local/lib/python3.10/site-packages/urduhack/command/cli.pylist_commands   s   zCLI.list_commandscmd_namec                 C   sl   i }t jtt| d }t|}t| |d}t||| W d   |d S 1 s-w   Y  |d S )z
         Get a specific command by looking up the module.
        Args:
            ctx (Any): Click context
            cmd_name (str): Command name
        Returns:
            (Any) Module's cli function
        r   execNcli)	r   pathjoinr   r   opencompilereadeval)r   r   r   n_sr   filecoder   r   r   get_command!   s   	

zCLI.get_commandN)	__name__
__module____qualname____doc__r   r   r   strr%   r   r   r   r   r      s    r   )clsc                   C   s   dS )z' Commands to help manage your project. Nr   r   r   r   r   r   5   s    r   )r)   r   typingr   r   clickr   r   dirname__file__r   r   MultiCommandr   commandr   r   r   r   r   <module>   s   
)