main
Download
38 lines 875 BGroffModified 2025-11-29 raw
1234567891011121314151617181920212223242526272829303132333435363738
'\" 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)