mirror of
https://github.com/NixOS/nix.git
synced 2025-11-11 21:16:02 +01:00
Perform tilde expansion when completing flake fragments
Allows completing `nix build ~/flake#<Tab>`. We can implement expansion for `~user` later if needed. Not using wordexp(3) since that expands way too much.
This commit is contained in:
parent
5461ff532d
commit
55c6906701
5 changed files with 21 additions and 6 deletions
|
|
@ -68,6 +68,9 @@ Path dirOf(const PathView path);
|
|||
following the final `/' (trailing slashes are removed). */
|
||||
std::string_view baseNameOf(std::string_view path);
|
||||
|
||||
/* Perform tilde expansion on a path. */
|
||||
std::string expandTilde(std::string_view path);
|
||||
|
||||
/* Check whether 'path' is a descendant of 'dir'. Both paths must be
|
||||
canonicalized. */
|
||||
bool isInDir(std::string_view path, std::string_view dir);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue