rc_t CC Usage (::Args const* args) { rc_t rc = 0; const char* progname = UsageDefaultName; const char* fullpath = UsageDefaultName; if (args == NULL) rc = RC(rcExe, rcArgv, rcAccessing, rcSelf, rcNull); else rc = ArgsProgram(args, &fullpath, &progname); UsageSummary (progname); printf("Parameters:\n"); HelpParamLine ("src-db-path", param_usage_src); HelpParamLine ("new-cache-db-path", param_usage_dst); printf ("\nOptions:\n"); HelpOptionLine (AlignCache::ALIAS_ID_SPREAD_THRESHOLD, AlignCache::OPTION_ID_SPREAD_THRESHOLD, "value", AlignCache::USAGE_ID_SPREAD_THRESHOLD); HelpOptionLine (NULL, AlignCache::OPTION_CURSOR_CACHE_SIZE, "value in MB", AlignCache::USAGE_CURSOR_CACHE_SIZE); HelpOptionLine (NULL, AlignCache::OPTION_MIN_CACHE_COUNT, "count", AlignCache::USAGE_MIN_CACHE_COUNT); XMLLogger_Usage(); printf ("\n"); HelpOptionsStandard (); HelpVersion (fullpath, KAppVersion()); return rc; }
rc_t CC Usage (const Args * args) { const char * progname = UsageDefaultName; const char * fullpath = UsageDefaultName; rc_t rc; if (args == NULL) rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull); else rc = ArgsProgram (args, &fullpath, &progname); UsageSummary (progname); KOutMsg ("Parameters:\n"); HelpParamLine ("source-file-path", first_usage); HelpParamLine ("extract-path", second_usage); KOutMsg ("Options:\n"); HelpOptionLine (ALIAS_XML, OPTION_XML, "XML-file", xml_usage); HelpOptionLine (ALIAS_DIR, OPTION_DIR, "directoy-path", dir_usage); HelpOptionLine (ALIAS_FORCE, OPTION_FORCE, NULL, force_usage); HelpOptionsStandard (); /* 1 2 3 4 5 6 7 8 */ /* 12345678901234567890123456789012345678901234567890123456789012345678901234567890 */ HelpVersion (fullpath, KAppVersion()); return rc; }
rc_t CC Usage(const Args* args) { rc_t rc = 0 ; const char* progname = UsageDefaultName; const char* fullpath = UsageDefaultName; if (args == NULL) { rc = RC(rcExe, rcArgv, rcAccessing, rcSelf, rcNull); } else { rc = ArgsProgram(args, &fullpath, &progname); } UsageSummary(progname); KOutMsg("Parameters:\n"); HelpParamLine ("db-path", param_usage); KOutMsg ("\nOptions:\n"); HelpOptionLine (ALIAS_ALL, OPTION_ALL, NULL, USAGE_ALL); HelpOptionLine (ALIAS_REF, OPTION_REF, NULL, USAGE_REF); HelpOptionLine (ALIAS_BAM, OPTION_BAM, NULL, USAGE_BAM); HelpOptionLine (ALIAS_QUA, OPTION_QUA, NULL, USAGE_QUA); HelpOptionsStandard (); HelpVersion (fullpath, KAppVersion()); return rc; }
rc_t CC Usage (const Args * args) { const char * progname = UsageDefaultName; const char * fullpath = UsageDefaultName; char const *const file_crypt = de[0] == 'd' ? "file to decrypt" : "file to encrypt"; char const *const dir_crypt = de[0] == 'd' ? "directory to decrypt" : "directory to encrypt"; const char * const pline[] = { file_crypt, NULL, "name of resulting file", NULL, "directory of resulting file", NULL, dir_crypt, NULL }; rc_t rc, orc; if (args == NULL) rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull); else rc = ArgsProgram (args, &fullpath, &progname); orc = UsageSummary (progname); if (rc == 0) rc = orc; KOutMsg ("Parameters:\n"); HelpParamLine ("source-file" , pline); HelpParamLine ("destination-file" , pline + 2); HelpParamLine ("destination-directory", pline + 4); HelpParamLine ("directory" , pline + 6); KOutMsg ("\nOptions:\n"); HelpOptionLine (ALIAS_FORCE, OPTION_FORCE, NULL, ForceUsage); CryptOptionLines (); HelpOptionsStandard (); /* forcing editor alignment */ /* 12345678901234567890123456789012345678901234567890123456789012345678901234567890*/ KOutMsg ( "\n" "Details:\n" " All %scryptions are non-destructive until successful. No files are deleted or\n" " replaced until the %scryptions are complete.\n" "\n", de, de); KOutMsg ( " The extension '.ncbi_enc' will be %s when a file is %scrypted.\n" "\n", Decrypting ? "removed" : "added", de); if (Decrypting) KOutMsg ( " NCBI Archive files that contain NCBI database objects will not be decrypted\n" " unless the %s option is used. As these objects can be used without\n" " decryption it is recommended they remain encrypted.\n" "\n", OPTION_SRA); else KOutMsg ( " NCBI Archive files that contain NCBI database objects will not have the\n" " .ncbi_enc extension added.\n\n"); KOutMsg ( " If the only parameter is a file name then it will be replaced by a file that\n" " is %scrypted with a possible changed extension.\n" " \n", de); KOutMsg ( " If the only parameter is a directory, all files in that directory including\n" " all files in subdirectories will be replaced with a possible change\n" " in the extension.\n" "\n"); KOutMsg ( " If there are two parameters a copy is made but the copy will be %scrypted.\n" " If the second parameter is a directory the new file might have a different\n" " extension. If it is not a directory, the extension will be as given in the\n" " the parameter.\n" "\n", de); KOutMsg ( " Missing directories in the destination path will be created.\n" "\n"); KOutMsg ( " Already existing destination files will cause the program to end with\n" " an error and will be left unchanged unless the --%s option is used to\n" " force the files to be overwritten.\n" "\n", OPTION_FORCE); KOutMsg ( "Encryption key (file password):\n" " The encryption key or file password is handled by configuration. If not yet\n" " set, this program will fail.\n\n" " You can set the encryption key by running:\n\n" " perl configuration-assistant.perl\n" "\n"); HelpVersion (fullpath, KAppVersion()); return rc; }
rc_t CC Usage (const Args * args) { const char * progname = UsageDefaultName; const char * fullpath = UsageDefaultName; rc_t rc; if (args == NULL) rc = RC (rcApp, rcArgv, rcAccessing, rcSelf, rcNull); else rc = ArgsProgram (args, &fullpath, &progname); UsageSummary (progname); KOutMsg ("Parameters:\n"); HelpParamLine ("source-file-path", first_usage); HelpParamLine ("destination-file-path", second_usage); KOutMsg ("\nOptions:\n"); HelpOptionLine (ALIAS_FORCE, OPTION_FORCE, NULL, force_usage); HelpOptionsStandard (); OUTMSG (("\n" "ncbi-file uri syntax:\n" " 'ncbi-file' uris are based on a combination of the standard\n" " 'file' and 'http' syntax familiar to browser users.\n" " Enclosing questions marks are probably necessary.\n" "\n" " URI syntax is 'scheme:'hierarchical-part'?'query'#'fragment'\n" " scheme:\n" " ncbi-file\n" " hierarchical-part:\n" " this is the same as for scheme file and can be the native form or\n")); OUTMSG ((" the ncbi 'posix' format that matches most flavors of Unix.\n" " Environment variables and short hands such as '~' are not interpreted.\n" " query:\n" " Zero or two symbols separated by the '&'. The whole query can be omitted.\n" " enc or encrypt\n" " pwfile='path to a file containing a password'\n" " pwfd='file descriptor where the password can be read'\n" " If the encrypt is present exactly one of the other two must be present.\n" " fragment:\n" " No fragment is permitted.\n")); OUTMSG (("\n" "password contents:\n" " The file or file descriptor containing the password is read enough to satisfy\n" " the following restriction. The password is terminated by the end of file,\n" " a carriage return or a line feed. The length must be no more than 4096 bytes.\n" " The password file should have limited read access to protect it.\n")); OUTMSG (("\n" "Use examples:" "\n" " To encrypt a create a file named 'example' with a password from a file\n" " named 'password-file' to a file named 'example.nenc' all in the current\n" " directory:\n" "\n" " $ %s example \"ncbi-file:example.nenc?encrypt&pwfile=password-file\"\n", progname)); OUTMSG (("\n" " To decrypt a file named 'example.nenc' with a password from a file\n" " named 'password-file' to a file named 'example' in directories implied\n" " in the command:\n" "\n" " $ %s \"ncbi-file:/home/user/downloads/example.nenc?encrypt&pwfile=/home/user/password-file\" example\n", progname)); OUTMSG (("\n" " To change the encryption of a file from one password to another:\n" "\n" " $ %s \"ncbi-file:/home/user/downloads/example.nenc?encrypt&pwfile=old-password-file\" \\\n" " \"ncbi-file:example.nenc?encrypt&pwfile=/home/user/new-password-file\"\n", progname)); HelpVersion (fullpath, KAppVersion()); return rc; }