uutils / coreutils

Cross-platform Rust rewrite of the GNU coreutils
https://uutils.github.io/
MIT License
17.74k stars 1.27k forks source link

ln: implement -n #1320

Closed E5ten closed 3 years ago

E5ten commented 5 years ago

-n, --no-dereference treat LINK_NAME as a normal file if it is a symbolic link to a directory -r, --relative create symbolic links relative to link location

AdaBehan commented 4 years ago

Is this still up for grabs ?

sylvestre commented 4 years ago

@adamRogerson it is! as a ride along, don't hesite to move ln from getopts to clap!

AdaBehan commented 4 years ago

@sylvestre Question for swapping over to clap. Do you want the error messages to be done by clap as well ? Currently a lot of input checking is done by hand but could be done with clap. This will may change the error message output which are tested for exactly in some places.

Example: https://github.com/uutils/coreutils/blob/a7de28a7140ec79f4cb550f7008a5f9e4bf2cb62/src/uu/ln/src/ln.rs#L159-L162

Could be like cp https://github.com/uutils/coreutils/blob/a7de28a7140ec79f4cb550f7008a5f9e4bf2cb62/src/uu/cp/src/cp.rs#L313

I think it would be best to let clap handle as much of this as possible but understand if you all wanted to keep the error messages exactly like in gnu version.

sylvestre commented 4 years ago

Yeah, exactly, we should leverage claps features!

I don't think the exact phrasing of the error message matters. Scripts should check for exit code anyway.

sylvestre commented 4 years ago

I needed -r

So, i did it : https://github.com/uutils/coreutils/pull/1540

sylvestre commented 4 years ago

Sorry if you started the work already :/

AdaBehan commented 4 years ago

No worries i hadn't even gotten to -r

On Mon, Jun 15, 2020 at 9:51 PM Sylvestre Ledru notifications@github.com wrote:

Sorry if you started the work already :/

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/uutils/coreutils/issues/1320#issuecomment-644382391, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABLWGTSOLXDEIWABN5O3VVLRW2CTLANCNFSM4GHUAI6Q .

-- Regards

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

tertsdiepraam commented 3 years ago

Both -n and -r seem to be implemented