
    ViX                        S SK Jr  S SKr " S S\5      r " S S\5      r " S S\5      r " S	 S
\5      r " S S\5      r	 " S S\5      r
 " S S\5      r " S S\5      r " S S\5      r " S S\\5      r " S S\5      rg)    )uniqueNc                       \ rS rSrSrSrg)FaceException   zcThe basest base exception Face has. Rarely directly instantiated
if ever, but useful for catching.
 N__name__
__module____qualname____firstlineno____doc____static_attributes__r       ^/home/james-whalen/.local/share/pipx/venvs/semgrep/lib/python3.13/site-packages/face/errors.pyr   r           	r   r   c                       \ rS rSrSrSrg)ArgumentParseError   zA base exception used for all errors raised during argument
parsing.

Many subtypes have a ".from_parse()" classmethod that creates an
exception message from the values available during the parse
process.
r   Nr   r   r   r   r   r      s     	r   r   c                       \ rS rSrSrSrg)ArgumentArityError   znRaised when too many or too few positional arguments are passed to
the command. See PosArgSpec for more info.
r   Nr   r   r   r   r   r      r   r   r   c                   (    \ rS rSrSr\S 5       rSrg)InvalidSubcommand   z3
Raised when an unrecognized subcommand is passed.
c                     [        UR                  R                  5        Vs/ s H
  o3S S S   PM     sn5      nSU< SSR                  U5      < 3nU " U5      $ s  snf )N   r   zunknown subcommand "", choose from: , )r   
subprs_mapkeysjoin)clsprssubcmd_namepathvalid_subcmdsmsgs         r   
from_parseInvalidSubcommand.from_parse#   sX     8K8K8MN8MRa8MNOtyy793x  Os   Ar   Nr	   r
   r   r   r   classmethodr(   r   r   r   r   r   r      s      r   r   c                   (    \ rS rSrSr\S 5       rSrg)UnknownFlag,   z-
Raised when an unrecognized flag is passed.
c                    [        UR                  5        Vs/ s H?  nUR                  R                  (       a  M   [        R
                  R                  U5      PMA     sn5      nSU< SSR                  U5      < 3nU " U5      $ s  snf )Nzunknown flag "r   r   )r   valuesdisplayhiddenfaceutilsformat_flag_labelr!   )r"   cmd_flag_map	flag_nameflagvalid_flagsr'   s         r   r(   UnknownFlag.from_parse0   s     *113P3 FJ;?<<;N;N Adjj::4@3P Q TYY{353x	Ps
   B#Br   Nr*   r   r   r   r-   r-   ,   s      r   r-   c                   ,    \ rS rSrSr\SS j5       rSrg)InvalidFlagArgument:   zRaised when the argument passed to a flag (the value directly
after it in argv) fails to parse. Tries to automatically detect
when an argument is missing.
Nc                 \   Uc  U " SUR                   -  5      $ UR                  n[        US[        R                  R
                  R                  U5      5      nUc  [        U5      nSnOSnXrR                   Xc4-  nU(       a  USU-  -  nUR                  S5      (       a  US-  nU " U5      $ )Nzexpected argument for flag %sdisplay_namez0flag %s converter (%r) failed to parse value: %rz)flag %s expected a valid %s value, not %rz (got error: %r)-z'. (Did you forget to pass an argument?))	nameparse_asgetattrr3   r4   FRIENDLY_TYPE_NAMESgetrepr
startswith)	r"   r6   r8   argexc
val_parservp_labeltmplr'   s	            r   r(   InvalidFlagArgument.from_parse?   s    ;6BCC]]
:~tzz7U7U7Y7YZd7efJ'HED>Dii//%++C>>#<<C3xr   r   Nr*   r   r   r   r<   r<   :   s      r   r<   c                   (    \ rS rSrSr\S 5       rSrg)InvalidPositionalArgumentV   zpRaised when one of the positional arguments does not
parse/validate as specified. See PosArgSpec for more info.
c                     [         R                  R                  UR                  5      u  pEU " SU< SU< SU< SU< S3	5      $ )Nz$positional argument failed to parse  z: z (got error: ))r3   r4   get_type_descrB   )r"   
posargspecrH   rI   prep	type_descs         r   r(   $InvalidPositionalArgument.from_parseZ   s<    **22:3F3FG04icK L 	Lr   r   Nr*   r   r   r   rP   rP   V   s     L Lr   rP   c                   (    \ rS rSrSr\S 5       rSrg)MissingRequiredFlagsa   zD
Raised when a required flag is not passed. See Flag for more info.
c                     [        U5      n/ nU H5  nX   nUR                  [        R                  R	                  U5      5        M7     SSR                  [        U5      5      -  nU " U5      $ )Nz(missing required arguments for flags: %sr   )setappendr3   r4   r5   r!   sorted)	r"   r6   parsed_flag_mapmissing_flag_names
flag_nameslabelsr7   r8   r'   s	            r   r(   MissingRequiredFlags.from_parsee   sd    +,
#I*DMM$**66t<= $ :6&>*+3xr   r   Nr*   r   r   r   r[   r[   a   s      r   r[   c                   (    \ rS rSrSr\S 5       rSrg)DuplicateFlagq   z_Raised when a flag is passed multiple times, and the flag's
"multi" setting is set to 'error'.
c                     SR                  U Vs/ s H  n[        U5      PM     sn5      n[        UR                  5      (       a  SUR                  < SU< 3nOSUR                  -  nU " U5      $ s  snf )Nr   z)more than one value was passed for flag "z": z<flag "%s" was used multiple times, but can be used only once)r!   rF   callablerB   rA   )r"   r8   arg_val_listvavl_textr'   s         r   r(   DuplicateFlag.from_parseu   sd    99|<|!d1g|<=DMM""ii+C RTXT]T]]C3x =s   A2r   Nr*   r   r   r   rg   rg   q   s      r   rg   c                   "    \ rS rSrSrSS jrSrg)CommandLineError   a  A :exc:`~face.FaceException` and :exc:`SystemExit` subtype that
enables safely catching runtime errors that would otherwise cause
the process to exit.

If instances of this exception are left uncaught, they will exit
the process.

If raised from a :meth:`~face.Command.run()` call and
``print_error`` is True, face will print the error before
reraising. See :meth:`face.Command.run()` for more details.
c                 :    [         R                  X5        X l        g rN   )
SystemExit__init__code)selfr'   ru   s      r   rt   CommandLineError.__init__   s    D&	r   )ru   N)r   )r	   r
   r   r   r   rt   r   r   r   r   rp   rp      s    
r   rp   c                       \ rS rSrSrS rSrg)
UsageError   a#  Application developers should raise this :exc:`CommandLineError`
subtype to indicate to users that the application user has used
the command incorrectly.

Instead of printing an ugly stack trace, Face will print a
readable error message of your choosing, then exit with a nonzero
exit code.
c                 l    U R                   S   nUR                  5       nSR                  U5      nSU-   $ )Nr   z
       zerror: )args
splitlinesr!   )rv   r'   liness      r   format_messageUsageError.format_message   s5    iil u%3r   r   N)r	   r
   r   r   r   r   r   r   r   r   ry   ry      s    r   ry   )boltons.iterutilsr   
face.utilsr3   	Exceptionr   r   r   r   r-   r<   rP   r[   rg   rs   rp   ry   r   r   r   <module>r      s    $ 	I 		 		+ 	
* 
$ , 8L 2 L-  & "}j "! r   