Skip to content

Commit 536c528

Browse files
chore(cli): Adds mimeType option (#323)
this matches the go command line tool
1 parent fe0f663 commit 536c528

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

cli/src/cli.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ async function tdf3EncryptParamsFor(argv: Partial<mainArgs>): Promise<EncryptPar
115115
if (argv.usersWithAccess?.length) {
116116
c.setUsersWithAccess(argv.usersWithAccess.split(','));
117117
}
118+
if (argv.mimeType?.length) {
119+
c.setMimeType(argv.mimeType);
120+
}
118121
// use offline mode, we do not have upsert for v2
119122
c.setOffline();
120123
// FIXME TODO must call file.close() after we are done
@@ -232,19 +235,25 @@ export const handleArgs = (args: string[]) => {
232235
.options({
233236
usersWithAccess: {
234237
alias: 'users-with-access',
235-
group: 'Policy Options',
238+
group: 'Encrypt Options',
236239
desc: 'Add users to the policy',
237240
type: 'string',
238241
default: '',
239242
validate: (users: string) => users.split(','),
240243
},
241244
attributes: {
242-
group: 'Policy Options',
245+
group: 'Encrypt Options',
243246
desc: 'Data attributes for the policy',
244247
type: 'string',
245248
default: '',
246249
validate: (attributes: string) => attributes.split(','),
247250
},
251+
mimeType: {
252+
group: 'Encrypt Options',
253+
desc: 'Mime type for the plain text file (only supported for ztdf)',
254+
type: 'string',
255+
default: '',
256+
},
248257
})
249258

250259
// COMMANDS

0 commit comments

Comments
 (0)