1 #include <mailutils/mailutils.h>
2
3 int owner_option;
4 int mode_option;
5 int force_option;
6
7 static struct mu_option *options[] = { NULL };
8
9 struct mu_cli_setup cli = {
10 options,
11 NULL,
12 "delete file",
13 "FILE"
14 };
15
16 static char *capa[] = {
17 "debug",
18 NULL
19 };
20
21 int
main(int argc,char ** argv)22 main (int argc, char **argv)
23 {
24 int rc;
25
26 mu_cli (argc, argv, &cli, capa, NULL, &argc, &argv);
27
28 if (argc != 1)
29 {
30 mu_error ("wrong number of arguments");
31 return 1;
32 }
33
34 if (!mu_file_name_is_safe (argv[0])
35 || (argv[0][0] == '/' && mu_str_count (argv[0], "/", NULL) < 2))
36 {
37 mu_error ("unsafe file name");
38 return 1;
39 }
40
41 rc = mu_remove_file (argv[0]);
42
43 if (rc)
44 mu_diag_funcall (MU_DIAG_ERROR, "mu_remove_file", NULL, rc);
45
46 return !!rc;
47 }
48
49
50