
    l:i
                     B    d dl mZ d dlmZ  edd      d        Zd Zy)	    )urlparse)for_appwhois   )at_leastc                      y)u*  
    What the `whois` command returns depends on the 'Whois server' it contacted
    and is not consistent through different servers. But there can be only two
    types of errors I can think of with `whois`:
        - `whois https://en.wikipedia.org/` → `whois en.wikipedia.org`;
        - `whois en.wikipedia.org` → `whois wikipedia.org`.
    So we match any `whois` command and then:
        - if there is a slash: keep only the FQDN;
        - if there is no slash but there is a point: removes the left-most
          subdomain.

    We cannot either remove all subdomains because we cannot know which part is
    the subdomains and which is the domain, consider:
        - www.google.fr → subdomain: www, domain: 'google.fr';
        - google.co.uk → subdomain: None, domain; 'google.co.uk'.
    T )commands    J/var/www/html/bot/venv/lib/python3.12/site-packages/thefuck/rules/whois.pymatchr      s    $     c           	      L   | j                   d   }d| j                  v rdt        |      j                  z   S d| j                  v r\t        |      j                  j                  d      }t        dt        |            D cg c]  }ddj                  ||d        z    c}S y c c}w )Nr   /zwhois .)	script_partsscriptr   netlocpathsplitrangelenjoin)r
   urlr   ns       r   get_new_commandr      s    


q
!C
gnn(3-....		}!!'',7<QD	7JK!388DH--KK 
Ks   ?B!N)six.moves.urllib.parser   thefuck.utilsr   r   r   r	   r   r   <module>r      s,    + ! 	1 (Lr   