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

//  editit.ado: list do and ado files working directory; click to edit
//  jslong@iu.edu - Scott Long

program define editit
    version 13.0
    syntax [ anything]

    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"
    local filelist `"`dofiles' `adofiles'"'
    local filelist : list sort filelist

    foreach file in `filelist' {
      display `"{stata doedit `file':`file'}"'
    }

end
exit