From 1003a18b85cffac4b9a92ee787fd8a9bdfca072d Mon Sep 17 00:00:00 2001 From: Shulhan Date: Fri, 3 Oct 2025 00:15:29 +0700 Subject: all: add option "$noparse" for magic "#put" command The "$noparse" option allow copying file without reading and parsing the input file. --- statement_test.go | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'statement_test.go') diff --git a/statement_test.go b/statement_test.go index 88981fa..760788e 100644 --- a/statement_test.go +++ b/statement_test.go @@ -145,6 +145,41 @@ func TestParseStatement(t *testing.T) { args: []string{`a`}, raw: []byte(` echo "a"`), }, + }, { + raw: []byte(`#put:user:group+0700$noparse src dst`), + exp: &Statement{ + kind: statementKindPut, + owner: `user:group`, + mode: 0700, + args: []string{`src`, `dst`}, + raw: []byte(`src dst`), + optNoparse: true, + }, + }, { + raw: []byte(`#put:+0700$noparse src dst`), + exp: &Statement{ + kind: statementKindPut, + mode: 0700, + args: []string{`src`, `dst`}, + raw: []byte(`src dst`), + optNoparse: true, + }, + }, { + raw: []byte(`#put:$noparse src dst`), + exp: &Statement{ + kind: statementKindPut, + args: []string{`src`, `dst`}, + raw: []byte(`src dst`), + optNoparse: true, + }, + }, { + raw: []byte(`#put:$unknown$noparse src dst`), + exp: &Statement{ + kind: statementKindPut, + args: []string{`src`, `dst`}, + raw: []byte(`src dst`), + optNoparse: true, + }, }} var ( -- cgit v1.3-6-g1900