Fossil SCM

Add better usage and help to the "artifact" command.

drh 2010-10-26 21:37 trunk
Commit 57347e6ee87ab62dc579b5b3102aade9e7ba928e
1 file changed +6 -2
+6 -2
--- src/content.c
+++ src/content.c
@@ -283,22 +283,26 @@
283283
}
284284
285285
/*
286286
** COMMAND: artifact
287287
**
288
-** Usage: %fossil artifact ARTIFACT-ID ?OUTPUT-FILENAME?
288
+** Usage: %fossil artifact ARTIFACT-ID ?OUTPUT-FILENAME? ?OPTIONS?
289289
**
290290
** Extract an artifact by its SHA1 hash and write the results on
291291
** standard output, or if the optional 4th argument is given, in
292292
** the named output file.
293
+**
294
+** Options:
295
+**
296
+** -R|--repository FILE Extract artifacts from repository FILE
293297
*/
294298
void artifact_cmd(void){
295299
int rid;
296300
Blob content;
297301
const char *zFile;
298302
db_find_and_open_repository(1);
299
- if( g.argc!=4 && g.argc!=3 ) usage("RECORDID ?FILENAME?");
303
+ if( g.argc!=4 && g.argc!=3 ) usage("ARTIFACT-ID ?FILENAME? ?OPTIONS?");
300304
zFile = g.argc==4 ? g.argv[3] : "-";
301305
rid = name_to_rid(g.argv[2]);
302306
content_get(rid, &content);
303307
blob_write_to_file(&content, zFile);
304308
}
305309
--- src/content.c
+++ src/content.c
@@ -283,22 +283,26 @@
283 }
284
285 /*
286 ** COMMAND: artifact
287 **
288 ** Usage: %fossil artifact ARTIFACT-ID ?OUTPUT-FILENAME?
289 **
290 ** Extract an artifact by its SHA1 hash and write the results on
291 ** standard output, or if the optional 4th argument is given, in
292 ** the named output file.
 
 
 
 
293 */
294 void artifact_cmd(void){
295 int rid;
296 Blob content;
297 const char *zFile;
298 db_find_and_open_repository(1);
299 if( g.argc!=4 && g.argc!=3 ) usage("RECORDID ?FILENAME?");
300 zFile = g.argc==4 ? g.argv[3] : "-";
301 rid = name_to_rid(g.argv[2]);
302 content_get(rid, &content);
303 blob_write_to_file(&content, zFile);
304 }
305
--- src/content.c
+++ src/content.c
@@ -283,22 +283,26 @@
283 }
284
285 /*
286 ** COMMAND: artifact
287 **
288 ** Usage: %fossil artifact ARTIFACT-ID ?OUTPUT-FILENAME? ?OPTIONS?
289 **
290 ** Extract an artifact by its SHA1 hash and write the results on
291 ** standard output, or if the optional 4th argument is given, in
292 ** the named output file.
293 **
294 ** Options:
295 **
296 ** -R|--repository FILE Extract artifacts from repository FILE
297 */
298 void artifact_cmd(void){
299 int rid;
300 Blob content;
301 const char *zFile;
302 db_find_and_open_repository(1);
303 if( g.argc!=4 && g.argc!=3 ) usage("ARTIFACT-ID ?FILENAME? ?OPTIONS?");
304 zFile = g.argc==4 ? g.argv[3] : "-";
305 rid = name_to_rid(g.argv[2]);
306 content_get(rid, &content);
307 blob_write_to_file(&content, zFile);
308 }
309

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button