File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,8 @@ def construct_include(loader: Loader, node: yaml.Node) -> Any:
5151 def __new__ (cls ):
5252 if cls ._instance is None :
5353 parser = argparse .ArgumentParser ()
54+ if not parser .prog .startswith ("uv run " ):
55+ parser .prog = f"uv run { parser .prog } "
5456 parser .add_argument ("-i" , "--id" , type = str , help = "Unique client ID." )
5557 parser .add_argument (
5658 "-p" , "--port" , type = str , help = "The port number for running a server."
@@ -125,8 +127,11 @@ def __new__(cls):
125127 with open (filename , "r" , encoding = "utf-8" ) as config_file :
126128 config = yaml .load (config_file , Loader )
127129 else :
128- # if the configuration file does not exist, raise an error
129- raise ValueError ("A configuration file must be supplied." )
130+ usage = parser .format_usage ().strip ()
131+ raise SystemExit (
132+ "Please provide a configuration file using the '-c' option.\n "
133+ f"{ usage } "
134+ )
130135
131136 Config .clients = Config .namedtuple_from_dict (config ["clients" ])
132137 Config .server = Config .namedtuple_from_dict (config ["server" ])
You can’t perform that action at this time.
0 commit comments