- printf("\nCitadel administration shell (c) 2009-2016 by citadel.org\n"
- "This is open source software made available to you under the terms\n"
- "of the GNU General Public License v3. All other rights reserved.\n"
- );
-
- opterr = 0;
- while ((c = getopt (argc, argv, "h:")) != -1) {
- switch(c) {
- case 'h':
- ctdldir = optarg;
- break;
- case '?':
- if (optopt == 'h') {
- fprintf(stderr, "Option -%c requires an argument\n", optopt);
- }
- else {
- fprintf(stderr, "Unknown option '-%c'\n", optopt);
- fprintf(stderr, "usage: %s [-h citadel_dir]\n", argv[0]);
+ for (i=1; i<argc; ++i) {
+ if (!strcmp(argv[i], "-h")) {
+ ctdldir = argv[++i];
+ }
+ else {
+ if (strlen(cmd) > 0) {
+ strcat(cmd, " ");