Giter Site home page Giter Site logo

Allow custom formatting of output about clifx HOT 7 CLOSED

tyrrrz avatar tyrrrz commented on May 8, 2024
Allow custom formatting of output

from clifx.

Comments (7)

Tyrrrz avatar Tyrrrz commented on May 8, 2024

Hi, thank you.
Do you have a use case for this?
Ideally we would want to have error messages so good that they won't need to be replaced, so if you have a suggestion how it should look, I'm all ears.
Technically it's not too hard to implement but I'd like to figure out what are the pros/cons.

from clifx.

thorhj avatar thorhj commented on May 8, 2024

I have three things that bother me right now:

  1. I think the argument type mismatch is too vague; it does not REALLY tell the user what went wrong. It tells the technical description of what went wrong (could not convert) but I think it should instead inform the user what was expected, e.g. The value 'abc' for option 'id' is invalid; it must be an integer.
  2. I want to wrap the CLI in a batch script so I can call it using myprogram command subcommand args instead of dotnet MyProgram.dll command subcommand args. The help text uses the latter format which I cannot change.
  3. I don't like the background color on the headers (Usage, Options, etc.), but that is a more of a subjective matter 😉

from clifx.

Tyrrrz avatar Tyrrrz commented on May 8, 2024
  1. Fair enough. The type names are kinda generic because you can use options of any time, but we can make special cases for base types.
  2. You can change it using .WithExecutableName() on CliApplicationBuilder. It's impossible to know that it was launched from a batch file unfortunately.
  3. The colors actually look different in different terminals. I assume you don't like how it looks in cmd?

from clifx.

thorhj avatar thorhj commented on May 8, 2024

You can change it using .WithExecutableName() on CliApplicationBuilder. It's impossible to know that it was launched from a batch file unfortunately.

Nice, exactly what I was looking for (it is UseExecutibleName() actually).

The colors actually look different in different terminals. I assume you don't like how it looks in cmd?

I use Cmder with a custom color scheme, but it has more to do with me not being a fan of background colors I guess.

I think the standard outputs that you have made are generally fine, but it would be nice to be able to customize them to one's own needs. I am not suggesting it is something you have to do as a consumer, but it would be nice to have the option.

from clifx.

Tyrrrz avatar Tyrrrz commented on May 8, 2024

Nice, exactly what I was looking for (it is UseExecutibleName() actually).

Oops.

from clifx.

Tyrrrz avatar Tyrrrz commented on May 8, 2024

Removed the background color on headers.

Also changed the errors in case of conversion failure, but they're still a bit technical.

from clifx.

Tyrrrz avatar Tyrrrz commented on May 8, 2024

Updated the error messages again. I'll be continually improving them to make them sound better. Closing this for now as I don't think I will be adding custom formatting.

from clifx.

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.