[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PATCH: relpath
From: |
Jim Meyering |
Subject: |
Re: PATCH: relpath |
Date: |
Sat, 31 Dec 2011 12:27:55 +0100 |
Pádraig Brady wrote:
...
>> Reading only the documentation for --relative-base=FILE,
>> I am not sure how it works:
>>
>> `--relative-base=FILE'
>> Ensure both the `--relative-to' and processed files are
>> subdirectories of FILE, or otherwise output the absolute file name.
>> Note this option honors the `-m' and `-e' options pertaining to
>> file existence.
>>
>> An example or two would help a lot.
>
> I'll add something along these lines:
Thanks.
> $ realpath --relative-to=/usr /tmp /usr/bin
> ../tmp
I see two lines of output. I guess you missed the latter?
$ ./realpath --relative-to=/usr /tmp /usr/bin
../tmp
bin
> $ realpath --relative-base=/usr --relative-to=/usr /tmp /usr/bin
> /tmp
> bin
Good. That makes it clearer.
The "Ensure" threw me. It's not really ensuring it.
Maybe something like this?
`--relative-base=BASE'
When both the `--relative-to' file and a listed FILE are
descendants of BASE, print a BASE-relative name for FILE.
Otherwise, print FILE's absolute name.
Note this option honors the `-m' and `-e' options pertaining to
file existence.
There's probably more to consider when the --relative-to= and
--relative-base= specified names are different, but I haven't
thought about that.
- Re: PATCH: relpath, (continued)
- Re: PATCH: relpath, Pádraig Brady, 2011/12/05
- Re: PATCH: relpath, Pádraig Brady, 2011/12/05
- Re: PATCH: relpath, Pádraig Brady, 2011/12/11
- Re: PATCH: relpath, Pádraig Brady, 2011/12/30
- Re: PATCH: relpath, Jim Meyering, 2011/12/31
- Re: PATCH: relpath, Pádraig Brady, 2011/12/31
- Re: PATCH: relpath, Jim Meyering, 2011/12/31
- Re: PATCH: relpath,
Jim Meyering <=
- Re: PATCH: relpath, Jim Meyering, 2011/12/31
- Re: PATCH: relpath, Jim Meyering, 2011/12/31
RE: PATCH: relpath, Voelker, Bernhard, 2011/12/05