<commit_before>if not nyagos then
    print("This is a script for nyagos not lua.exe")
    os.exit()
end

share.maincmds = {}

-- git
local githelp=io.popen("git help -a 2>nul","r")
if githelp then
    local gitcmds={}
    for line in githelp:lines() do
        if string.match(line,"^  %S") then
            for word in string.gmatch(line,"%S+") do
                gitcmds[ #gitcmds+1 ] = word
            end
        end
    end
    githelp:close()
    if #gitcmds > 1 then
        local maincmds = share.maincmds
        maincmds["git"] = gitcmds
        maincmds["git.exe"] = gitcmds
        share.maincmds = maincmds
    end
end

-- Subversion
local svnhelp=io.popen("svn help 2>nul","r")
if svnhelp then
    local svncmds={}
    for line in svnhelp:lines() do
        local m=string.match(line,"^   ([a-z]+)")
        if m then
            svncmds[ #svncmds+1 ] = m
        end
    end
    svnhelp:close()
    if #svncmds > 1 then
        local maincmds = share.maincmds
        maincmds["svn"] = svncmds
        maincmds["svn.exe"] = svncmds
        share.maincmds = maincmds
    end
end

-- Mercurial
local hghelp=io.popen("hg debugcomplete 2>nul","r")
if hghelp then
    local hgcmds={}
    for line in hghelp:lines() do
        for word in string.gmatch(line,"[a-z]+") do
            hgcmds[#hgcmds+1] = word
        end
    end
    hghelp:close()<commit_msg>fix git completion<commit_after>if not nyagos then
    print("This is a script for nyagos not lua.exe")
    os.exit()
end

share.maincmds = {}

-- git
local githelp=io.popen("git help -a 2>nul","r")
if githelp then
    local gitcmds={}
    for line in githelp:lines() do
        local word = string.match(line,"^ +(%S+)")
        if nil ~= word then
          gitcmds[ #gitcmds+1 ] = word
        end
    end
    githelp:close()
    if #gitcmds > 1 then
        local maincmds = share.maincmds
        maincmds["git"] = gitcmds
        maincmds["git.exe"] = gitcmds
        share.maincmds = maincmds
    end
end

-- Subversion
local svnhelp=io.popen("svn help 2>nul","r")
if svnhelp then
    local svncmds={}
    for line in svnhelp:lines() do
        local m=string.match(line,"^ +([a-z]+)")
        if m then
            svncmds[ #svncmds+1 ] = m
        end
    end
    svnhelp:close()
    if #svncmds > 1 then
        local maincmds = share.maincmds
        maincmds["svn"] = svncmds
        maincmds["svn.exe"] = svncmds
        share.maincmds = maincmds
    end
end

-- Mercurial
local hghelp=io.popen("hg debugcomplete 2>nul","r")
if hghelp then
    local hgcmds={}
    for line in hghelp:lines() do
        for word in string.gmatch(line,"[a-z]+") do
            hgcmds[#hgcmds+1] = word
        end
    end
    hghelp:close()
{'fraction_non_alphanumeric': 0.12430632630410655, 'fraction_numerical': 0.0059193488716241215, 'mean_word_length': 2.1849234393404005, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '5086870', 'n_tokens_mistral': 1027, 'n_tokens_neox': 998, 'n_words': 257}