tools.cli

Change contract to provide access to banner on parse error

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

If a user provides an invalid option, most applications would want to display the banner.

tools.cli throws an Exception with minimal information, and (banner-for) is marked private.

The exception could be replaced with one that provides access to the banner, but I think it would be better (easier to use, more idiomatic?) to change the contract so that the banner is always returned. Given the exception string is also useful, perhaps change cli to return a map with keys [:options :extra-args :banner :parse-failure]?

Activity

Hide
Gunnar Völkel added a comment -

I agree with the reporter. Throwing an exception for invalid arguments ("[...] is not a valid argument") is not appropriate since you usually want to display that error message along with the banner.

Show
Gunnar Völkel added a comment - I agree with the reporter. Throwing an exception for invalid arguments ("[...] is not a valid argument") is not appropriate since you usually want to display that error message along with the banner.

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated: