cli: better errors on arguent parsing

This commit is contained in:
Ruslan Sayfutdinov
2023-12-18 13:59:33 +00:00
committed by Ruslan Sayfutdinov
parent 86ead9f4a4
commit 8052cd0131
4 changed files with 66 additions and 21 deletions
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
println "+ zstd --blah" >&2
zstd --blah
println "+ zstd -xz" >&2
zstd -xz
println "+ zstd --adapt=min=1,maxx=2 file.txt" >&2
zstd --adapt=min=1,maxx=2 file.txt
println "+ zstd --train-cover=k=48,d=8,steps32 file.txt" >&2
zstd --train-cover=k=48,d=8,steps32 file.txt
+1
View File
@@ -0,0 +1 @@
1
+28
View File
@@ -0,0 +1,28 @@
+ zstd --blah
Incorrect parameter: --blah
...
Usage: zstd *
Options:
...
+ zstd -xz
Incorrect parameter: -x
...
Usage: zstd *
Options:
...
+ zstd --adapt=min=1,maxx=2 file.txt
Incorrect parameter: --adapt=min=1,maxx=2
...
Usage: zstd *
Options:
...
+ zstd --train-cover=k=48,d=8,steps32 file.txt
Incorrect parameter: --train-cover=k=48,d=8,steps32
...
Usage: zstd *
Options:
...