Output VCSRevision with --version

This commit is contained in:
Kovid Goyal 2022-08-16 21:26:55 +05:30
parent d39036de2a
commit 20ad7ca437
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ def main() -> None:
os.environ.pop('KITTY_PREWARM_SOCKET') os.environ.pop('KITTY_PREWARM_SOCKET')
os.execlp(sys.executable, sys.executable, '+launch', __file__, *sys.argv[1:]) os.execlp(sys.executable, sys.executable, '+launch', __file__, *sys.argv[1:])
with open('constants.go', 'w') as f: with open('constants.go', 'w') as f:
dp = ", ".join(map(lambda x: f'"{serialize_as_go_string}"', kc.default_pager_for_help)) dp = ", ".join(map(lambda x: f'"{serialize_as_go_string(x)}"', kc.default_pager_for_help))
f.write(f'''\ f.write(f'''\
// auto-generated by {__file__} do no edit // auto-generated by {__file__} do no edit

View File

@ -329,7 +329,7 @@ func show_usage(cmd *cobra.Command) error {
if cmd.Annotations["usage-suffix"] != "" { if cmd.Annotations["usage-suffix"] != "" {
fmt.Fprintln(&output, cmd.Annotations["usage-suffix"]) fmt.Fprintln(&output, cmd.Annotations["usage-suffix"])
} else { } else {
fmt.Fprintln(&output, italic_fmt(RootCmd.Name()), opt_fmt(RootCmd.Version), "created by", title_fmt("Kovid Goyal")) fmt.Fprintln(&output, italic_fmt(RootCmd.Name()), opt_fmt(kitty.VersionString), "created by", title_fmt("Kovid Goyal"))
} }
output_text := output.String() output_text := output.String()
// fmt.Printf("%#v\n", output_text) // fmt.Printf("%#v\n", output_text)