jrenner / linux-directory-help

dirhelp - a command line tool to give information about the linux directory structures (FHS)
Other
34 stars 4 forks source link

Include information on XDG folders #3

Open qwitwa opened 11 years ago

qwitwa commented 11 years ago

Including information/explanation about folders from the XDG specification would be helpful.

The complication is that since those folders are defined by environment variables, the current approach of testing the directory by regular expression on a preset list of directories isn't going to work.

If the target audience of this program is mainly new users, this could probably be ignored, and help strings for the defaults such as "~/.local/share" could be hard-coded into the program.

jrenner commented 11 years ago

Seems worth doing, but not urgent

jrenner commented 11 years ago

latest commit moved from regex to map based directory info. now it will be simple to get the XDG environment variables, and add their info to the map.

qwitwa commented 11 years ago

Nice. I might go learn Go and do it myself. If this is still open by the time I get round to that I'll send you a pull request.

I cloned the project in python for fun here, and got environment variables working by splitting the helpstring into lines and checking the first character of each line to figure out what the line means, then using the python standard library's os.path to expand variables.