console icon indicating copy to clipboard operation
console copied to clipboard

Minor usability tweaks

Open jippi opened this issue 1 year ago • 0 comments

First off, thanks for a great library 🎉

I'm currently working on integrating this into my project dottie and this is the accumulated fixes / improvements i've made along the way

  • Pass in a base context.Context to (*console.Console).Start() allowing for application/command wide context keys can propagate properly when running commands
  • Print errors to ErrOrStderr instead of Stdout
  • Correctly surface cancellation cause in console.execute() - it was previously always context.Canceled since you need to call context.Cause() to get the underlying real error
  • Use explicit return err in console.execute() to simplify debugging
  • Implement custom error types for most errors to ease detection and tracking of them
  • Reuse AddHistorySource in AddHistorySourceFile instead of duplicating logic
  • Reset flag values (in particular Slice flags) values between runs so they don't accumulate

jippi avatar Mar 01 '24 21:03 jippi