2 Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
17 #endif /* HAVE_CONFIG_H */
20 #include <sys/types.h>
29 #include <atalk/cnid.h>
30 #include <atalk/logger.h>
31 #include <atalk/util.h>
32 #include <atalk/netatalk_conf.h>
36 static void usage_main(void)
38 printf("Usage: ad ls|cp|rm|mv|find [file|dir, ...]\n");
39 printf(" ad -v|--version\n");
42 static void show_version(void)
44 printf("ad (Netatalk %s)\n", VERSION);
47 int main(int argc, char **argv)
51 setuplog("default:note", "/dev/tty");
58 if (afp_config_parse(&obj) != 0)
61 if (load_volumes(&obj, NULL) != 0)
64 if (STRCMP(argv[1], ==, "ls"))
65 return ad_ls(argc - 1, argv + 1);
66 else if (STRCMP(argv[1], ==, "cp"))
67 return ad_cp(argc - 1, argv + 1);
68 else if (STRCMP(argv[1], ==, "rm"))
69 return ad_rm(argc - 1, argv + 1);
70 else if (STRCMP(argv[1], ==, "mv"))
71 return ad_mv(argc, argv);
72 else if (STRCMP(argv[1], ==, "find"))
73 return ad_find(argc, argv);
74 else if (STRCMP(argv[1], ==, "-v")) {
78 else if (STRCMP(argv[1], ==, "--version")) {