From dcb7043403b227a8351b5864d5b856a2c81b69b9 Mon Sep 17 00:00:00 2001 From: "Michael Hirsch, Ph.D" Date: Mon, 18 Nov 2019 00:04:33 -0500 Subject: fs: add expanduser method this should help users specify leading `~` in various Meson options and variables without refactoring lots of places inside Meson itself. --- docs/markdown/Fs-module.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/markdown/Fs-module.md b/docs/markdown/Fs-module.md index 36b4c4a..3b33e7f 100644 --- a/docs/markdown/Fs-module.md +++ b/docs/markdown/Fs-module.md @@ -37,7 +37,7 @@ by the string is a symbolic link. ### is_absolute -Return a boolean indicating if the path string specified is absolute for this computer, WITHOUT expanding `~`. +Return a boolean indicating if the path string specified is absolute, WITHOUT expanding `~`. Examples: @@ -96,7 +96,19 @@ fs.is_samepath(p, s) # false ## Filename modification -The files need not actually exist yet for these methods, as they are just string manipulation. +The files need not actually exist yet for these path string manipulation methods. + +### expanduser + +A path string with a leading `~` is expanded to the user home directory + +Examples: + +```meson +fs.expanduser('~') # home directory + +fs.expanduser('~/foo') # /foo +``` ### as_posix -- cgit v1.1