X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvtag.c;h=edf97662dc1c58374c30022b6bb546c27e13d64e;hb=1dd534f9534eeda713ba543170ba954e56a95c07;hp=3aa6cc4a94866f086ae17d2fea601ed208152930;hpb=3564d8678a2134185e5e6e83083de027b359ca28;p=util-vserver.git diff --git a/src/vtag.c b/src/vtag.c index 3aa6cc4..edf9766 100644 --- a/src/vtag.c +++ b/src/vtag.c @@ -38,6 +38,7 @@ #define CMD_CREATE 0x4001 #define CMD_MIGRATE 0x4002 #define CMD_SILENTEXIST 0x4003 +#define CMD_SILENT 0x4004 struct option const @@ -47,6 +48,7 @@ CMDLINE_OPTIONS[] = { { "tag", required_argument, 0, CMD_TAG }, { "create", no_argument, 0, CMD_CREATE }, { "migrate", no_argument, 0, CMD_MIGRATE }, + { "silent", no_argument, 0, CMD_SILENT }, { "silentexist", no_argument, 0, CMD_SILENTEXIST }, { 0,0,0,0 }, }; @@ -72,6 +74,8 @@ showHelp(int fd, char const *cmd, int res) " can be:\n" " --silentexist ... be silent when context exists already; useful\n" " for '--create' only\n" + " --silent ... if the feature is not supported, just execute\n" + " \n" "\n" "'vtag --create' exits with code 254 iff the context exists already.\n" "\n" @@ -96,8 +100,15 @@ doit(struct Arguments const *args, char *argv[]) { tag_t tag; - if (!vc_isSupported(vcFEATURE_PPTAG)) - goto exec; + if (!vc_isSupported(vcFEATURE_PPTAG)) { + if (args->verbosity >= 1) { + errno = ENOSYS; + perror(ENSC_WRAPPERS_PREFIX); + return wrapper_exit_code; + } + else + goto exec; + } if (args->do_create) { tag = vc_tag_create(args->tag); @@ -139,7 +150,7 @@ int main (int argc, char *argv[]) while (1) { int c = getopt_long(argc, argv, "+", CMDLINE_OPTIONS, 0); if (c==-1) break; - + switch (c) { case CMD_HELP : showHelp(1, argv[0], 0); case CMD_VERSION : showVersion(); @@ -147,6 +158,7 @@ int main (int argc, char *argv[]) case CMD_MIGRATE : args.do_migrate = true; break; case CMD_SILENTEXIST : args.is_silentexist = true; break; case CMD_TAG : args.tag = Evc_tagopt2tag(optarg,true); break; + case CMD_SILENT : args.verbosity--; break; default : WRITE_MSG(2, "Try '");