Coder Social home page Coder Social logo

Comments (4)

ugexe avatar ugexe commented on August 28, 2024 1

One of the other options that was discussed was showing the prefix directory stuff once towards the start or end of the help message (possibly only verbose help), and showing only the script name everywhere else in the help. This is nice because when you invoke a script without it being installed (i.e. zef would not work yet) the message still gives enough information to tell if you are running what you really want.

If anyone is inclined to implement this you can find the code here, and the part that handle the file path / invocation name shown is here

from zef.

ugexe avatar ugexe commented on August 28, 2024

This is an issue with Rakudo itself and will affect all perl6 scripts that are installed and precompiled. The only way to fix this outside of Rakudo would be to implement an entire GetOpts library in the zef distribution.

from zef.

ugexe avatar ugexe commented on August 28, 2024

FWIW this occurs because Rakudo installs a wrapper to invoke the actual script that gets installed, so an installed bin/zef not actually the original script and simply invokes the script (which is saved in the hash file shown).

So why can't Rakudo just show 'zef'? This is due to the possibility of shadowed commands, I.e. you may have two directories in PATH that each have a bin/zef. Only the first bin/zef could honestly be represented as 'zef', because otherwise the help command would be lying about how to invoke the script it's a part of. Combined with the "wrapper" scripts (of the same name) that get installed you can see why there is not an easy solution.

zef --help doesn't use Rakudo to auto generate its help message - if it did it would look the same. Unfortunately there is no way to override the current help message that occurs when inputting bad arguments.

from zef.

vadz avatar vadz commented on August 28, 2024

I appreciate the explanations, but FWIW this is overcomplicating things: IMHO Rakudo could still just show zef and nobody would really complain about any ambiguities due to presence of more than just one zef in the PATH, this is not what's really expected from the help message.

Or, to put it otherwise, IMO breaking the common case while trying to address a vanishingly rare scenario is not worth it.

This being said, I'm closing this as it's not really a zef issue in any case. Thanks again for taking time to write the replies!

from zef.

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.