]> git.walde.dev - punch/commitdiff
Clean up usage print statements
authorDustin Walde <redacted>
Sat, 23 Sep 2023 04:12:02 +0000 (21:12 -0700)
committerDustin Walde <redacted>
Sat, 23 Sep 2023 04:12:02 +0000 (21:12 -0700)
src/punch.py

index c1a8e232feddc69c9bc482c1d64aaeea9bdbe81c..38e26ec425543be7ce436268b9db754c02252c3f 100644 (file)
@@ -25,6 +25,13 @@ logging.getLogger().addHandler(logging.StreamHandler(sys.stdout))
 logger = logging.getLogger(__name__)
 
 
+USAGE = """
+Punch usage:
+punch <command> <...args>
+Available commands: daemon, help, in, out, pop, query, service, to, undo
+List additional command info with: punch help <command>
+"""
+
 def col_str_tuple(col):
     if len(col) == 4:
         return (int(col[1]*2, 16),
@@ -39,10 +46,7 @@ def col_str_tuple(col):
 
 def print_usage(command: Optional[str] = None):
     if command is None:
-        print("Punch usage:")
-        print("punch <command> <...args>")
-        print("Available commands: daemon, help, in, out, pop, query, service, to, undo")
-        print("List additional command info with: punch help <command>")
+        print(USAGE)
     else:
         print("No usage info for", command)