license
license copied to clipboard
UI improvements and refactoring
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
ignoresEOF
if some bytes are already read (e.g., when a user typesabc<C-d><C-d>
, where<C-d>
is Ctrl-D, the<C-d>
behaves as if it is theenter
key;abc
is returned anderror
isnil
)