소스 검색

Added argument documentation for watch

koerschens 3 년 전
부모
커밋
0b9614d949
1개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. 9 2
      python/gpu_status.py

+ 9 - 2
python/gpu_status.py

@@ -1,11 +1,18 @@
 import argparse
-from typing import Protocol
-
 import requests
+
 from renderer import Renderer
 
 parser = argparse.ArgumentParser(description="Prints the status of server nodes and their GPUs.")
 
+
+parser.add_argument(
+    "watch", 
+    type=str,
+    nargs="?",
+    choices=("watch",),
+    help="If the word 'watch' is supplied as first argument, the script will be run in watch mode. Supplying this argument in any other position will have no effect."
+)
 parser.add_argument(
     "-s", 
     "--server",