Git Product home page Git Product logo

Comments (6)

Boscop avatar Boscop commented on September 27, 2024 2

Alternatively, to let the programmer decide (because maybe they want to use -h for something else),
there should be a way to manually call the function that prints the usage information (that's called when --help is passed).
So that it can be manually called when -h is passed with an explicit #[argh(switch, short = 'h')] help: bool field.

I.e. this function:

pub(crate) fn help(

But wrapped in a nicer way, callable as a method on the struct that FromArgs is derived on.

from argh.

icefoxen avatar icefoxen commented on September 27, 2024 2

Agreed on the -h shorthand flag. As for anything else, I don't want programmers to decide that -h should mean anything else, I want it to just be always a shorthand for --help.

from argh.

benbrittain avatar benbrittain commented on September 27, 2024 1

I'd be far more amicable to that change! That seems like a good option for those that want -h support

from argh.

msrd0 avatar msrd0 commented on September 27, 2024 1

I'd also like to see an -h shorthand flag, and I'd be willing to create a PR. However, I am concerned that letting the user implement the shorthand and argh worry about the long flag, the help would end up looking something like that:

Options:
  -h                display usage information
  --help            display usage information

Therefore, I think either the user should be given the option to specify a shorthand for the help message, or be able to "replace" the help switch altogether. Let me know what you think.

from argh.

aminya avatar aminya commented on September 27, 2024 1

I made a pull request that fixes this issue #106

from argh.

benbrittain avatar benbrittain commented on September 27, 2024

oh interesting, yes that makes sense. I'm open to a change like that!

from argh.

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.