+
     ph"  c                   s^    ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIH	t	  ! R R4      t
R# )i    N)DEFAULT_CONFIGURATION_FILE_PATHOutputFormat)UnknownCommandExceptionc                   sL   a  ] tR t^t o RtRtRtRR ltR tR t	R	R lt
RtV tR# )
CommandParserTNc                sR    Wn         V P                  4        V P                  4        R # N)	is_remoteinit_parserinit_legacy_parser)selfr   s   &&=/usr/lib/python3.14/site-packages/fw_fanctrl/CommandParser.py__init__ZCommandParser.__init__   s    "!    c                sj   \         P                  ! R R\        P                  ! R4      \         P                  R7      V n        V P
                  P                  RRR\        R.RR7       V P
                  P                  R	R
R \        \        P                  4      \        P                  R7       V P
                  P                  RR7      pRVn        V P                  '       g   VP                  RR\         P                  R7      pVP                  RR\         P                   R7       VP                  RRR\"         R2\        \"        R7       VP                  RRRRR7       VP                  RR R!\        R".R"R7       VP                  R#R$RR7       VP                  R%R&R'7      pVP                  RR(R)7       VP                  R*R+R'7       VP                  R,R-R'7       VP                  R.R/R'7       VP                  R0R1R'7       VP                  R2R3\         P                  R7      pVP                  R4R5\$        P&                   R6\$        P&                   R7\$        P&                   R8\$        P&                   R92	R:\        . RCOR;R<7       VP                  R=R>R'7      pVP                  R?R@\        RA7       RB# )Dz
fw-fanctrlz4control Framework's laptop fan(s) with a speed curvezeobtain more help about a command or subcommand using `fw-fanctrl <command> [subcommand...] -h/--help`)ZprogdescriptionZepilogformatter_class--socket-controller--sczNthe socket controller to use for communication between the cli and the serviceunix)helptypechoicesdefaultz--output-formatz/the output format to use for the command resultc                 sJ   a  \        \        S 4      '       d   V 3R  l! 4       # S # )c                  s   < \         S ,          # r   r   Zss   r
   <lambda>Z=CommandParser.init_parser.<locals>.<lambda>.<locals>.<lambda>*   s	    LOr   )hasattrr   r   s   fr
   r   Z+CommandParser.init_parser.<locals>.<lambda>*   s    ',PQ:R:R36YXYYr   command)ZdestTrunzrun the service)r   r   strategyz]name of the strategy to use e.g: "lazy" (use `print strategies` to list available strategies))r   nargs--configz-cz&the configuration file path (default: Z))r   r   r   z--silentz-sz,disable printing speed/temp status to stdout
store_true)r   action--hardware-controller--hczQthe hardware controller to use for fetching and setting the temp and fan(s) speedectoolz--no-battery-sensorsz,disable checking battery temperature sensorsusezchange the current strategy)r   zXname of the strategy to use e.g: "lazy". (use `print list` to list available strategies))r   resetzreset to the default strategyreloadzreload the configuration filepausezpause the serviceresumezresume the serviceprintzprint the selected informationprint_selectionzall - All detailszcurrent - The current strategyz list - List available strategiesz(speed - The current fan speed percentagez$active - The service activity status?all)r   r   r   r   r   
set_configz7replace the service configuration with the provided oneZprovided_configz"must be a valid JSON configuration)r   r   N)r+   ZactivecurrentlistZspeed)argparseArgumentParsertextwrapZdedentZRawTextHelpFormatterparseradd_argumentstrr.   r   Z_member_names_NATURALZadd_subparsersZrequiredr   Z
add_parserZOPTIONALr    osZlinesep)r	   Zcommands_sub_parserZrun_commandZuse_commandZprint_commandZset_config_commands   &     r
   r   ZCommandParser.init_parser   s   --N??w %99
 	  !aH 	! 	
 	  BY445 (( 	! 	
 #kk88i8H'+$~~~-88- ( = = 9 K
 $$t'' % 
 $$=>]=^^_`7 %  $$C#	 %  $$'h!
  %  $$&C# %  *44UHe4f  k 	! 	

 	&&w<[&\&&x=\&]&&w<O&P&&x=Q&R+668$99 7 

 	""$RZZL0NrzzlZz{}  |F  |F  {G  Go  pr  pz  pz  o{  {_  `A 	# 	
 1;;&_ < 
 	''5 	( 	
r   c                s   \         P                  ! R R7      V n        R pV P                  P                  R4      pVP	                  RRVR7       VP	                  RRR7       V P                  P                  R	4      pVP	                  R
RR7       VP	                  R\
        \        R7       VP	                  RRR7       V P                  P                  R4      pVP	                  RRRR7       VP	                  RRR7       VP	                  RRRR7       VP	                  RRR7       VP	                  RRR7       VP	                  RR\
        R.RR7       VP	                  RR\
        R.RR7       R# ) F)Zadd_helpc                 sN    V R9   d   \         P                  ! RV ,          4      hV # )r   z%s is an excluded value)r   r#   r%   r$   r&   r'   r(   r,   )r/   ZArgumentTypeError)Zvalues   &r
   excluded_positional_argumentsZGCommandParser.init_legacy_parser.<locals>.excluded_positional_arguments~   s-     	 	 001JU1RSSLr   Zboth	_strategyr*   )r   r   z
--strategy)r   r   z--runr   )r   r   )r   r   z--no-logZ	configurez--queryz-qz--list-strategiesz--reloadz-rz--pausez--resumer    r!   r"   )r   r   r   r   r   r   N)r/   r0   legacy_parserZadd_argument_groupr3   r4   r    )r	   r7   Z
both_groupZ	run_groupZcommand_groups   &    r
   r   Z CommandParser.init_legacy_parserz   sq   %44eD	 ''::6B
3=Z[C8&&99%@	w|<z=\]z,?**==kJ""9d<"H""#6|"L"":tL"I""9\"B"":l"C""#J 	# 	
 	""!H 	# 	
r   c                s   \         P                  p\        \        P                  R 4      \         n         V P
                  P                  V4      pVP                  f   VP                  Vn        \        P                  ! 4       pVP                  Vn        \        P                  Vn        VP                  '       d   RVn        RVn        VP$                  '       d   RVn        RVn        VP&                  '       d   RVn        VP(                  '       d   RVn        VP*                  '       d   RVn        VP,                  '       dL   RVn        VP.                  Vn        VP2                  Vn        VP4                  Vn        VP                  Vn        \7        VR4      '       g'   VP                  e   R	Vn        VP                  Vn        \7        VR4      '       g   \9        R
4      hV P:                  '       g   VP                   R8X  d   \=        R4       T\         n        T#   \>        \@        3 d*    T\         n        T PB                  P                  T4      p LFi ; i  T\         n        i ; i)Zwr(   r-   r.   r'   r&   r%   r   r   r#   znot a valid legacy commandz[Warning] > this command is deprecated and will be removed soon, please use the new command format instead ('fw-fanctrl -h' for more details).)"sysZstderrZopenr6   Zdevnullr9   
parse_argsr   r8   r/   Z	NamespaceZsocket_controllerr   r5   Zoutput_formatZqueryr   r)   Zlist_strategiesr'   r&   r%   r   Zno_logZsilentZhardware_controllerZconfigr   r   r   r(   Z
SystemExitZ	Exceptionr2   )r	   ZargsZoriginal_stderrZlegacy_valuesZvaluess   &&   r
   r;   ZCommandParser.parse_args   s   **"**c*
(	) ..99$?M%%-)6)@)@&'')F'4'F'FF$#/#7#7F """!()2&,,,!()/&###!)"""!(###!)   !& - 4 4-:-N-N* - 4 4"/"8"869---2H2H2T!&"/"8"869---.JKK~~~5!8 e )CJ I& 	2(CJ[[++D1F	2 )CJsO   BH" <H" H" <H" H" .H" B1H" 9H" "7II II I,)r   r9   r2   )Fr   )Z__name__Z
__module__Z__qualname__Z__firstlineno__r   r9   r2   r   r   r   r;   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r
   r   r      s0     IMF"
b
H-
^- -r   r   )r/   r6   r:   r1   Z
fw_fanctrlr    Zfw_fanctrl.enum.OutputFormatr   Z,fw_fanctrl.exception.UnknownCommandExceptionr   r   ) r   r
   <module>r<      s&     	 
  6 5 PK Kr   