@@ -5,12 +5,12 @@ import packages/docutils/highlite, terminal
55var all_models: JsonNode = nil
66
77proc show_help () =
8- echo """
9- Usage: ./program [OPTIONS]
8+ echo fmt """
9+ Usage: { paramStr ( 0 ) } [OPTIONS]
1010
1111A command-line interface for interacting with language models using libchatllm.
1212
13- Options:
13+ Options (run `main -h` to get a full list of options) :
1414 -m, --model <model_id> Specify the model to use (e.g., :qwen:1.5b)
1515 --embedding_model <model_id> Specify the embedding model to use
1616 --reranker_model <model_id> Specify the reranker model to use
@@ -21,9 +21,9 @@ Options:
2121 -h, --help Show this help message
2222
2323Examples:
24- ./program -m :qwen:1.5b -p "Hello, world!"
25- ./program --interactive --model :qwen:1.5b
26- ./program --help
24+ { paramStr ( 0 ) } -m :qwen:1.5b -p "Hello, world!"
25+ { paramStr ( 0 ) } --interactive --model :qwen:1.5b
26+ { paramStr ( 0 ) } --help
2727"""
2828
2929proc get_model_url_on_modelscope (url: seq [string ]): string =
@@ -211,6 +211,10 @@ var interactive: bool = false
211211var reversed_role = false
212212var use_multiple_lines = false
213213
214+ if paramCount () < 1 :
215+ show_help ()
216+ quit (0 )
217+
214218for i in 1 .. paramCount ():
215219 if paramStr (i) in [" -h" , " --help" ]:
216220 show_help ()
0 commit comments