blob: 0f3ee0d0efbdb264de08602c6d0e32d8420df357 (
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
37
38
|
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Path.expand_home 3 2025-11-29 "Tomo man-pages"
.SH NAME
Path.expand_home \- expand ~ to $HOME
.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.
.SH ARGUMENTS
.TS
allbox;
lb lb lbx
l l l.
Name Type Description
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
# Assume current user is 'user'
assert (~/foo).expand_home() == (/home/user/foo)
# No change
assert (/foo).expand_home() == (/foo)
.EE
.SH SEE ALSO
.BR Tomo-Path (3)
|