*! v0.0.1 2018-08-03 Scott Long

// list do files click to edit

capture program drop editit
program define editit
    version 13.0
    syntax [ anything] [ , DETails DIRectories DELete hold]

    local dospec : subinstr local anything ".do" "", all
    local adospec : subinstr local anything ".ado" "", all

    if "`dospec'"=="" & "`adospec'"=="" {
        local dospec "*"
        local adospec "*"
    }

    local dofiles : dir "`c(pwd)'" files "`dospec'.do"
    local adofiles : dir "`c(pwd)'" files "`adospec'.ado"

    display as text " "
    foreach file in `dofiles' `adofiles' {
        local nspaces = 2
        di `"{space `nspaces'}{stata doedit  `file':`file'}"'
    } // file loop

end
exit