o
    g                     @   s@   d dl Z d dlZd dlZG dd de jZdejd fddZdS )    Nc                   @   sv   e Zd Z	dddZdd Zdd	 Zd
d ZdddZedd Z	edd Z
edd Zedd Zedd ZdS )_ManHelpFormatterr      O   c                 C   s   t j| |||| |  d S N)optparseHelpFormatter__init__)selfindent_incrementmax_help_positionwidthshort_first r   ^/home/ubuntu/cloudmapper/venv/lib/python3.10/site-packages/pylint/config/man_help_formatter.pyr      s   
z_ManHelpFormatter.__init__c                 C   s   d|   dS )Nz.SH 
)upper)r	   headingr   r   r   format_heading   s   z _ManHelpFormatter.format_headingc                 C   s   |S r   r   )r	   descriptionr   r   r   format_description   s   z$_ManHelpFormatter.format_descriptionc                 C   s   z|j }W n ty   | |}Y nw |jr5| |}ddd | D }|dd}|dd}nd}d	| d
| dS )N c                 s       | ]}|  V  qd S r   strip.0liner   r   r   	<genexpr>        z2_ManHelpFormatter.format_option.<locals>.<genexpr>\z\\z	[current:z	[default: z.IP "z"
r   )option_stringsAttributeErrorformat_option_stringshelpexpand_defaultjoin
splitlinesreplace)r	   option	optstring	help_texthelp_stringr   r   r   format_option   s   

z_ManHelpFormatter.format_option   c                 C   sz   d}z|  }W n ty   | }Y nw | ||j}t|dr)| ||j}| || d| d| 	| d| S )Nr    	long_descr   )
_get_prog_namer"   get_prog_nameformat_short_descriptionr   hasattrformat_long_descriptionr/   format_titleformat_synopsis)r	   	optparserpkginfosectionr/   pgm
short_descr   r   r   format_head)   s    
z_ManHelpFormatter.format_headc                 C   s0   dt  d d  }d|  d| d| d|  S )Nz%d-%02d-%02d   z.TH r   z "z" )time	localtime)r:   r9   dater   r   r   r5   8   s
   z_ManHelpFormatter.format_titlec                 C   s   d|  d|   dS )Nz.SH NAME
.B z
\- r   r   )r:   r;   r   r   r   r2   @   s
   z*_ManHelpFormatter.format_short_descriptionc                 C   s   d|  dS )Nz.SH SYNOPSIS
.B  z#
[
.I OPTIONS
] [
.I <arguments>
]
r   )r:   r   r   r   r6   G   s   z!_ManHelpFormatter.format_synopsisc                 C   sX   d dd | D }|dd}| | r!|t| d  }d|  d|  dS )Nr   c                 s   r   r   )lstripr   r   r   r   r   T   r   z<_ManHelpFormatter.format_long_description.<locals>.<genexpr>z
.
z

z.SH DESCRIPTION
.B )r&   r'   r(   lower
startswithlenr   )r:   r/   r   r   r   r4   R   s   z)_ManHelpFormatter.format_long_descriptionc              	   C   sL   dt | dd d| j d| j d| j d	}t| dr$|d	| j d
7 }|S )Nz&.SH SEE ALSO
/usr/share/doc/pythonX.Y-debian_namepylintz>/

.SH BUGS
Please report bugs on the project's mailing list:
z

.SH AUTHOR
z <z>
	copyrightz
.SH COPYRIGHT
r   )getattrmailinglistauthorauthor_emailr3   rG   )r8   tailr   r   r   format_tail]   s   



z_ManHelpFormatter.format_tailN)r   r   r   r   )r.   )__name__
__module____qualname__r   r   r   r-   r<   staticmethodr5   r2   r6   r4   rM   r   r   r   r   r   
   s"    







r   r.   c                 C   sP   t  }||_| |_t|| |||d t| ||d t|||d d S )N)file)r   output_levelparserprintr<   format_option_helprM   )r7   r8   r9   streamlevel	formatterr   r   r   _generate_manpageq   s   rZ   )r   sysr>   r   r   stdoutrZ   r   r   r   r   <module>   s
   g