Qf@ gdZddlZ ddlmZGddeZeZgfdZgfdZ d Z d Z d Z d Z ed k(r$ddlZeeej"dddddgyy#e$rdZYWwxYw)) GetoptErrorerrorgetopt gnu_getoptN)gettextc|SN)ss -/opt/alt/python312/lib64/python3.12/getopt.py_r )sQhc"eZdZdZdZddZdZy)rcN||_||_tj|||yr )msgopt Exception__init__)selfrrs r rzGetoptError.__init__.s"4c*rc|jSr )r)rs r __str__zGetoptError.__str__3s xxrN)r)__name__ __module__ __qualname__rrrrr rr rr+s C C+ rrc~ g}t|tr|g}n t|}|r|djdr|ddk7rz|ddk(r |dd} ||fS|djdrt ||ddd||dd\}}nt ||ddd||dd\}}|r|djdr |ddk7rz||fS)Nr---) isinstancestrlist startswithdo_longs do_shorts)args shortoptslongoptsoptss r rr8s4 D(C :> 47%%c*tAw#~ 7d?8D  : 7  d #!$Q XtABxHJD$"4aiabJJD$ 47%%c*tAw#~ :rc g}g}t|tr|g}n t|}|jdr|dd}d}n$tj j drd}nd}|r|ddk(r ||ddz } ||fS|ddddk(rt||ddd||dd\}}nS|dddd k(r#|dd k7rt||ddd||dd\}}n%|r ||z } ||fS|j|d|dd}|r||fS) N+rTPOSIXLY_CORRECTFrrr r) r!r"r#r$osenvirongetr%r&append)r'r(r)r* prog_argsall_options_firsts r rrcs\  DI(C :>C abM   ) * !  7d? ab !I  ? 72A;$ !$Q XtABxHJD$ !WRa[C DGsN"4aiabJJD$ T!  ?  a)ABx " ?rcB |jd}|d|||dzd}}t||\}}|r'|?|stt d|z||d|dd}}n|tt d|z||j d|z|xsdf||fS#t$rd}Y}wxYw)N=rzoption --%s requires argumentrz%option --%s must not have an argumentrr)index ValueError long_has_argsrr r1)r*rr)r'ioptarghas_args r r%r%s) IIcN"1gs1Q34yV h/LGS >!!$C"Ds"JCPP7DHDF  !CDsJCPPKKV\r*+ : sB BBc6|Dcgc]}|j|s|}}|sttd|z|||vrd|fS|dz|vrd|fSt|dkDrttd|z||d}|j d}|r|dd}||fScc}w) Nzoption --%s not recognizedFr5Trzoption --%s not a unique prefixr)r$rr lenendswith)rr)o possibilities unique_matchr;s r r8r8s (>1ALL,=QM> !89C?EE mcz sm #Sy =A!=>DcJJ #L##C(G#CR( L  %?s BBc|dk7rb|d|dd}}t||r.|dk(r$|sttd|z||d|dd}}|d}}nd}|jd|z|f|dk7rb||fS)Nrrrzoption -%s requires argumentr) short_has_argrr r1)r* optstringr(r'rr:s r r&r&s r/"1y}Y i (B%a(F&G#&M&)++"&q'484 )2IFF S3Y'( r/ :rctt|D]*}|||cxk(rdk7sn|jd|dzcStt d|z|)N:rzoption -%s not recognized)ranger>r$rr )rr(r9s r rDrDsW 3y> " )A, %# %''QqS1 1# a34s:C @@r__main__rza:bzalpha=beta)__all__r.rr ImportErrorrrrrrr%r8r&rDrsysprintargvr rr rPsB 8 $ )  '))V,.0d,!* A  z &!"ux&8 9:]sAA)(A)