@@ -84,21 +84,20 @@ async function write(toWrite: unknown, outPath?: string) {
8484async function run ( ) {
8585 await yargs ( process . argv . slice ( 2 ) )
8686 . command (
87- 'fromCredentials <...pathToCredential> ' ,
87+ 'fromCredentials [pathToCredential..] ' ,
8888 'create a Did Configuration Resource from one or more existing Domain Linkage Credentials' ,
8989 ( ygs ) =>
90- ygs . options ( commonOpts ) . positional ( 'pathsToCredential ' , {
90+ ygs . options ( commonOpts ) . positional ( 'pathToCredential ' , {
9191 describe : 'Path to a json file containing the credential presentation' ,
9292 type : 'string' ,
9393 demandOption : true ,
9494 array : true ,
9595 } ) ,
96- async ( { pathsToCredential, outFile } ) => {
97- const credentials : DomainLinkageCredential [ ] = [ ]
98- await Promise . all (
99- pathsToCredential . map ( async ( pathToCredential ) => {
96+ async ( { pathToCredential, outFile } ) => {
97+ const credentials : DomainLinkageCredential [ ] = await Promise . all (
98+ pathToCredential . map ( async ( pathToCredential ) => {
10099 try {
101- credentials . push ( JSON . parse ( await readFile ( pathToCredential , { encoding : 'utf-8' } ) ) )
100+ return JSON . parse ( await readFile ( pathToCredential , { encoding : 'utf-8' } ) )
102101 } catch ( cause ) {
103102 throw new Error ( `Cannot parse file ${ pathToCredential } ` , { cause } )
104103 }
@@ -117,14 +116,16 @@ async function run() {
117116 )
118117 . command (
119118 'credentialOnly' ,
120- 'issue a new Kilt Credential Presentation for use in a Did Configuration Resource' ,
119+ 'issue a new Domain Linkage Credential for use in a Did Configuration Resource' ,
121120 {
122121 ...createCredentialOpts ,
123122 ...commonOpts ,
124123 proofType : {
125124 alias : 'p' ,
126125 choices : [ DataIntegrity . PROOF_TYPE , KILT_SELF_SIGNED_PROOF_TYPE ] as const ,
127126 default : KILT_SELF_SIGNED_PROOF_TYPE ,
127+ describe :
128+ 'Which proof type to use in the credential. DataIntegrity is the more modern proof type, but might not be accepted by all extensions yet. Did Configuration Resources can contain multiple credentials, though.' ,
128129 } ,
129130 } ,
130131 async ( { origin, seed, keyType, wsAddress, outFile, did, proofType } ) => {
@@ -135,7 +136,7 @@ async function run() {
135136 )
136137 . command (
137138 '$0' ,
138- 'create a Did Configuration Resource from a freshly issued Verifiable Credential ' ,
139+ 'create a Did Configuration Resource containing newly issued Domain Linkage Credentials ' ,
139140 { ...createCredentialOpts , ...commonOpts } ,
140141 async ( { origin, seed, keyType, wsAddress, outFile, did } ) => {
141142 await connect ( wsAddress )
0 commit comments