aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-Path.expand_home.3
blob: c2571b32f035fc7eca0ad1396731cb9cd11f11ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Path.expand_home 3 2025-04-19T14:48:15.715066 "Tomo man-pages"
.SH NAME
Path.expand_home \- For home-based paths (those starting with `~`), expand the path to replace the tilde with and absolute path to the user's `$HOME` directory.

.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Path.expand_home\ :\ func(path:\ Path\ ->\ Path)
.fi

.SH DESCRIPTION
For home-based paths (those starting with `~`), expand the path to replace the tilde with and absolute path to the user's `$HOME` directory.


.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
path	Path	The path to expand. 	-
.TE
.SH RETURN
If the path does not start with a `~`, then return it unmodified. Otherwise, replace the `~` with an absolute path to the user's home directory.

.SH EXAMPLES
.EX
>> (~/foo).expand_home() # Assume current user is 'user'
= /home/user/foo
>> (/foo).expand_home() # No change
= /foo
.EE