normalize: Add "./" if a path starts with a "-"

This commit is contained in:
Fabian Homborg
2022-03-26 10:45:22 +01:00
parent bb3700997c
commit b961afed49
3 changed files with 17 additions and 1 deletions

View File

@@ -239,6 +239,8 @@ Examples
Unlike ``realpath`` or ``path resolve``, it does not make the paths absolute. It also does not resolve any symlinks. As such it can operate on non-existent paths.
Leading "./" components are usually removed. But when a path starts with ``-``, ``path normalize`` will add it instead to avoid confusion with options.
It returns 0 if any normalization was done, i.e. any given path wasn't in canonical form.
Examples
@@ -257,6 +259,9 @@ Examples
>_ path normalize ./my/subdirs/../sub2
my/sub2
>_ path normalize -- -/foo
./-/foo
"resolve" subcommand
--------------------