Coder Social home page Coder Social logo

Comments (6)

N-R-K avatar N-R-K commented on May 28, 2024 1

how vigilant do you think we should be with this?

The fix looks simple. So there's no point in not doing the correct thing, IMO.

from nnn.

KlzXS avatar KlzXS commented on May 28, 2024 1

See #1820

from nnn.

KlzXS avatar KlzXS commented on May 28, 2024

Do they all have double dash options separator for the mv command?

-- as a marker for the end of options is a POSIX guideline, so it should be widely supported. Not to mention that it's been standard practice for many years. Of course, individual programs may not respect it, but mv most certainly will.

The same would go for cp and rm as well. And all the uses inside plugins. @jarun how vigilant do you think we should be with this? At least core nnn I'd say, but what about plugins?

from nnn.

jarun avatar jarun commented on May 28, 2024

Yes, please raise the PR. Also check for other places in the code where it may be an issue.

We should fix this in plugins too.

from nnn.

Oxore avatar Oxore commented on May 28, 2024

I found that a similar functionality exists in the cpmv_rename function. It uses similar shell pipeline defined in patterns[P_CPMVRNM] that does not use the double dash separator (--) too, but it mvs and cpies files without a problem even if the name starts with a dash. This and the fact, that I don't fully understand neither of these two shell pipelines, takes away the last bit of any confidence I had to create a PR with the simple the double dash separator fix.

from nnn.

KlzXS avatar KlzXS commented on May 28, 2024

cpmv_rename() and batch_rename() (when dealing with selection) use absolute paths. You don't get this problem with absolute paths as the first character is by definition /.

So the fix is not strictly necessary in those cases, but it doesn't hurt them either. Just smack on a -- everywhere you see cp, mv or rm. Other shell programs might also benefit from the same treatment but leave those for now.

I don't fully understand neither of these two shell pipelines

Also, fair point. Those pipelines have zero documentation to their name other than "they do what they do". I should write something for that when I get some more time.

from nnn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.