summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorJonathan Arnett <jonarnett90@gmail.com>2017-04-28 11:26:39 -0400
committerJonathan Arnett <jonarnett90@gmail.com>2017-04-28 14:33:23 -0400
commita9de33643b1503b87359bda0828beeea2ed0162e (patch)
tree3b5a25aecbaae75c8719b719db505afb8ebe1e31 /lib
parent9193bcaeecd567d40015e352a5320b657edea34a (diff)
downloadNim-a9de33643b1503b87359bda0828beeea2ed0162e.tar.gz
Appended to comment
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/ospaths.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/pure/ospaths.nim b/lib/pure/ospaths.nim
index 4c667dd92..050482279 100644
--- a/lib/pure/ospaths.nim
+++ b/lib/pure/ospaths.nim
@@ -516,6 +516,14 @@ when declared(getEnv) or defined(nimscript):
   proc getConfigDir*(): string {.rtl, extern: "nos$1",
     tags: [ReadEnvEffect, ReadIOEffect].} =
     ## Returns the config directory of the current user for applications.
+    ##
+    ## On non-Windows OSs, this proc conforms to the XDG Base Directory
+    ## spec. Thus, this proc returns the value of the XDG_CONFIG_DIR environment
+    ## variable if it is set, and returns the default configuration directory,
+    ## "~/.config/", otherwise.
+    ##
+    ## An OS-dependent trailing slash is always present at the end of the
+    ## returned string; `\\` on Windows and `/` on all other OSs.
     when defined(windows): return string(getEnv("APPDATA")) & "\\"
     elif getEnv("XDG_CONFIG_DIR"): return string(getEnv("XDG_CONFIG_DIR")) & "/"
     else: return string(getEnv("HOME")) & "/.config/"