mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Document SQLTester's --print command and add some argument validation to it.
FossilOrigin-Name: ab9c945bb0b4210b3f47e6341f150f8a7cc45f9e4e4c2247e91d2528ed4772a6
This commit is contained in:
@ -574,6 +574,9 @@ class OpenDbCommand extends Command {
|
||||
class PrintCommand extends Command {
|
||||
public PrintCommand(){}
|
||||
public void process(SQLTester t, String[] argv, String content) throws Exception{
|
||||
if( 1==argv.length && null==content ){
|
||||
Util.badArg(argv[0]," requires at least 1 argument or body content.");
|
||||
}
|
||||
if( argv.length > 1 ) t.outln("\t",Util.argvToString(argv));
|
||||
if( null!=content ) t.outln(content.replaceAll("(?m)^", "\t"));
|
||||
}
|
||||
|
@ -244,3 +244,8 @@ respectively. The difference is that column values are appended to the
|
||||
result buffer literally, without every enclosing the values in `{...}` or
|
||||
`"..."` and without escaping any characters in the column value and comparison
|
||||
is always an exact strcmp() not a GLOB.
|
||||
|
||||
### The --print command
|
||||
|
||||
The --print command emits both its arguments and its body (if any) to
|
||||
stdout, indenting each line of output.
|
||||
|
@ -18,6 +18,7 @@ select 2;
|
||||
--oom
|
||||
--print These are args to the print command.
|
||||
This is from the print command's body.
|
||||
--print
|
||||
Also from the print command.
|
||||
--- also ignored
|
||||
--testcase first
|
||||
|
Reference in New Issue
Block a user