<commit_before>import sys
import os
import crunchbase



def print_usage_and_exit():
    usage_string = '''
python crunchbase_client.py <options>

Options:

    --help      Print this message and exit.
    --show-company             <company>
    --show-person              <person>
    --show-financial-org       <financial-org>
    --show-product             <product>
    --show-service             <service>

    --search-keyword           <keyword>

    --list-companies
    --list-persons
    --list-financial-orgs
    --list-products
    --list-services

    --find-company-permalink   <company>
    --find-person-permalink    <person>
    --find-financial-permalink <financial-org>
    --find-product-permalink   <product>
    --find-service-permalink   <service>

    --find-company-posts       <company>
    --find-person-posts        <person>
    --find-financial-posts     <financial-org>
    --find-product-posts       <product>
    --find-service-posts       <service>
'''    
    sys.exit(usage_string)



action_table = {
    '--show-company':                 crunchbase.show_company ,   
    '--show-person':                  crunchbase.show_person ,   
    '--show-financial-org':           crunchbase.show_financial_org ,   
    '--show-product':                 crunchbase.show_product ,   
    '--show-service':                 crunchbase.show_service ,   
    '--search-keyword':               crunchbase.search_keyword ,   
    '--list-companies':               crunchbase.list_companies,
    '--list-persons':                 crunchbase.list_persons,
    '--list-financial-orgs':          crunchbase.list_financial_orgs,
    '--list-products':                crunchbase.list_products,
    '--list-services':                crunchbase.list_services,
    '--find-company-permalink':       crunchbase.find_company_permalink,
    '--find-person-permalink':        crunchbase.find_person_permalink,
    '--find-financial-org-permalink': crunchbase.find_financial_org_permalink,
    '--find-product-permalink':       crunchbase.find_product_permalink,
    '--find-service-permalink':       crunchbase.find_service_permalink,
    '--find-company-posts':           crunchbase.find_company_posts,
    '--find-person-posts':            crunchbase.find_person_posts,
    '--find-financial-org-posts':     crunchbase.find_financial_org_posts,
    '--find-product-posts':           crunchbase.find_product_posts,
    '--find-service-posts':           crunchbase.find_service_posts
}
    


def execute_command_line_input():
    opt = sys.argv[1]
    if opt == '--help':
        print_usage_and_exit()
    elif opt.startswith('--show'):
        action_table[opt](sys.argv[2])
    elif opt.startswith('--search'):
        action_table[opt](sys.argv[2])
    elif opt.startswith('--list'):
        action_table[opt]()
    elif opt.startswith('--find'):
        action_table[opt](sys.argv[2])
    else:
        sys.exit('Unrecognized option: ' + opt)
         


#
# MAIN
#
execute_command_line_input()<commit_msg>Added check for 0 args, Changed persons to people.<commit_after>import sys
import os
import crunchbase



def print_usage_and_exit():
    usage_string = '''
python crunchbase_client.py <options>

Options:

    --help      Print this message and exit.
    --show-company             <company>
    --show-person              <person>
    --show-financial-org       <financial-org>
    --show-product             <product>
    --show-service             <service>

    --search-keyword           <keyword>

    --list-companies
    --list-people
    --list-financial-orgs
    --list-products
    --list-services

    --find-company-permalink   <company>
    --find-person-permalink    <person>
    --find-financial-permalink <financial-org>
    --find-product-permalink   <product>
    --find-service-permalink   <service>

    --find-company-posts       <company>
    --find-person-posts        <person>
    --find-financial-posts     <financial-org>
    --find-product-posts       <product>
    --find-service-posts       <service>
'''    
    sys.exit(usage_string)



action_table = {
    '--show-company':                 crunchbase.show_company ,   
    '--show-person':                  crunchbase.show_person ,   
    '--show-financial-org':           crunchbase.show_financial_org ,   
    '--show-product':                 crunchbase.show_product ,   
    '--show-service':                 crunchbase.show_service ,   
    '--search-keyword':               crunchbase.search_keyword ,   
    '--list-companies':               crunchbase.list_companies,
    '--list-people':                  crunchbase.list_people,
    '--list-financial-orgs':          crunchbase.list_financial_orgs,
    '--list-products':                crunchbase.list_products,
    '--list-services':                crunchbase.list_services,
    '--find-company-permalink':       crunchbase.find_company_permalink,
    '--find-person-permalink':        crunchbase.find_person_permalink,
    '--find-financial-org-permalink': crunchbase.find_financial_org_permalink,
    '--find-product-permalink':       crunchbase.find_product_permalink,
    '--find-service-permalink':       crunchbase.find_service_permalink,
    '--find-company-posts':           crunchbase.find_company_posts,
    '--find-person-posts':            crunchbase.find_person_posts,
    '--find-financial-org-posts':     crunchbase.find_financial_org_posts,
    '--find-product-posts':           crunchbase.find_product_posts,
    '--find-service-posts':           crunchbase.find_service_posts
}
    


def execute_command_line_input():
    if len(sys.argv) < 2:
        print_usage_and_exit()
    opt = sys.argv[1]
    if opt == '--help':
        print_usage_and_exit()
    elif opt.startswith('--show'):
        action_table[opt](sys.argv[2])
    elif opt.startswith('--search'):
        action_table[opt](sys.argv[2])
    elif opt.startswith('--list'):
        action_table[opt]()
    elif opt.startswith('--find'):
        action_table[opt](sys.argv[2])
    else:
        sys.exit('Unrecognized option: ' + opt)
         


#
# MAIN
#
execute_command_line_input()
{'fraction_non_alphanumeric': 0.13290932811480757, 'fraction_numerical': 0.0016307893020221786, 'mean_word_length': 2.055804683607374, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1029250', 'n_tokens_mistral': 1977, 'n_tokens_neox': 1931, 'n_words': 263}