2009-10-27 06:16:00 +05:30
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <xbps_api.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char **argv)
|
|
|
|
{
|
2009-10-30 07:43:03 +05:30
|
|
|
int rv = 0;
|
|
|
|
|
2009-10-27 06:16:00 +05:30
|
|
|
if (argc != 2) {
|
|
|
|
printf("Usage: xbps-fetch [options] URL\n");
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
}
|
|
|
|
|
2009-10-30 07:43:03 +05:30
|
|
|
rv = xbps_fetch_file(argv[1], ".");
|
|
|
|
if (rv != 0) {
|
|
|
|
printf("xbps-fetch: couldn't download %s!\n", argv[1]);
|
|
|
|
printf("xbps-fetch: %s\n", xbps_fetch_error_string());
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
}
|
|
|
|
exit(EXIT_SUCCESS);
|
2009-10-27 06:16:00 +05:30
|
|
|
}
|