ig_repertoire_constructor icon indicating copy to clipboard operation
ig_repertoire_constructor copied to clipboard

VJ Finder. Command line hell when 1 parameter is provided.

Open seryrzu opened this issue 7 years ago • 0 comments

Testing: 0eb6e39a054262595dce097f88708f4e6119d144

  1. ./build/release/bin/vj_finder succeeds and runs VJF on test dataset.

  2. ./build/release/bin/vj_finder "configs/vj_finder/config.info" fails but should be equivalent to 1.

vjf_test
   0:00:00.000    4M /    4M   INFO VJFinderLaunch           (vjf_launch.cpp            :  21)   == VJ Finder starts ==
libc++abi.dylib: terminating with uncaught exception of type seqan::UnknownExtensionError: Unknown file extension of configs/vj_finder/config.info: unspecified iostream_category error
[1]    37188 abort      ./build/release/bin/vj_finder configs/vj_finder/config.info

Consequently, we have no way to handle custom config without explicitly providing all necessary parameters through command line.

  1. ./build/release/bin/vj_finder -h fails
File -h doesn't exist or can't be read!
  1. ./build/release/bin/vj_finder --help fails and nothing is printed.

  2. ./build/release/bin/vj_finder --version fails and nothing is printed.

  3. ./build/release/bin/vj_finder --help-hidden fails and nothing is printed

  4. ./build/release/bin/vj_finder -v fails

File -v doesn't exist or can't be read!

In src/main.cpp lines 45-50:

std::string get_config_fname(int argc, char **argv) {
    if(argc == 2 and (std::string(argv[1]) != "--help" and std::string(argv[1]) != "--version" and
            std::string(argv[1]) != "--help-hidden"))
        return std::string(argv[1]);
    return "configs/vj_finder/config.info";
}

should be changed to smth like this:

std::string get_config_fname(int argc, char **argv) {
    if(argc == 2 and (std::string(argv[1]) != "--help" and std::string(argv[1]) != "-h" and
                     std::string(argv[1]) != "--version" and std::string(argv[1]) != "-v" and 
                     std::string(argv[1]) != "--help-hidden"))
        return std::string(argv[1]);
    return "configs/vj_finder/config.info";
}

(-h and -v are missing)

In file command_line_routines.cpp lines 6-13

bool command_line_requires_parsing(int argc, char **argv) {
    if(argc == 1)
        return false;
    if(argc > 2)
        return true;
    return std::string(argv[1]) != "--help" or
           std::string(argv[1]) != "--version" or std::string(argv[1]) != "--help-hidden";
}

should be changed to smth like this

bool command_line_requires_parsing(int argc, char **argv) {
    if(argc == 1)
        return false;
    if(argc > 2)
        return true;
    return std::string(argv[1]) == "--help"     or std::string(argv[1]) == "-h" or 
           std::string(argv[1]) == "--version" or std::string(argv[1]) == "-v" or
           std::string(argv[1]) == "--help-hidden";
}

Note that previously the last return was always true.

seryrzu avatar Mar 23 '17 18:03 seryrzu