license icon indicating copy to clipboard operation
license copied to clipboard

UI improvements and refactoring

Open elpinal opened this issue 7 years ago • 0 comments

User Interface improvements

Number input

  • remove leading and trailing whitespace
  • on the non-Windows environments, there was a bug where the input's trailing \n is not removed

Both number & string input

  • abort dialog if scanning from stdin failed
  • properly put a newline if scanning failed
  • Ctrl-D, which causes EOF, comes to end up a user input

Main program

  • delay creating an output file and, if any, its parent directory so that when replacement generates any error, any files and directories are not created
  • correct a number that the MIT license is assigned: as it was, it caused panic
  • let users know the names of the licenses after they input a number; this change makes them assured because users may mistakenly input an accidental number

Others

  • arrange some outputs mainly when they report errors
  • fix typos
  • refactor

Notes

  • #6 is seemingly correct, but actually bufio.ReadLine ignores EOF if some bytes are already read (e.g., when a user types abc<C-d><C-d>, where <C-d> is Ctrl-D, the <C-d> behaves as if it is the enter key; abc is returned and error is nil)

elpinal avatar Feb 15 '18 12:02 elpinal