<commit_before>import os
import subprocess
import sys

def find_command(name):
    return commands[name]

def what_is_this_command():
    repository = find_current_repository()
    if repository is None:
        print "Could not find source control repository"
    else:
        print "{0}+file://{1}".format(repository.type, repository.path)

def find_current_repository():
    directory = os.getcwd()
    while directory is not None:
        files = os.listdir(directory)
        if ".git" in files:
            return Repository(os.path.join(directory, ".git"), "git")
        
        directory = parent(directory)
        
    return None<commit_msg>Allow path to be explicitly set when using what-is-this<commit_after>import os
import subprocess
import sys

def find_command(name):
    return commands[name]

def what_is_this_command():
    directory = sys.argv[2] if len(sys.argv) > 2 else os.getcwd()
    repository = find_repository(directory)
    if repository is None:
        print "Could not find source control repository"
    else:
        print "{0}+file://{1}".format(repository.type, repository.path)

def find_repository(directory):
    directory = os.path.abspath(directory)
    while directory is not None:
        files = os.listdir(directory)
        if ".git" in files:
            return Repository(os.path.join(directory, ".git"), "git")
        
        directory = parent(directory)
        
    return None
{'fraction_non_alphanumeric': 0.10174216027874565, 'fraction_numerical': 0.004181184668989547, 'mean_word_length': 2.9668508287292816, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '6462865', 'n_tokens_mistral': 406, 'n_tokens_neox': 404, 'n_words': 118}