Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
int main(int argc, char **argv) {
    if (argc < 2) { 
      printTitle("Delly");
      displayUsage();
      return 0;
    }

    if ((std::string(argv[1]) == "version") || (std::string(argv[1]) == "--version") || (std::string(argv[1]) == "--version-only") || (std::string(argv[1]) == "-v")) {
      std::cout << "Delly version: v" << dellyVersionNumber << std::endl;
      std::cout << " using Boost: v" << BOOST_VERSION / 100000 << "." << BOOST_VERSION / 100 % 1000 << "." << BOOST_VERSION % 100 << std::endl;
      std::cout << " using HTSlib: v" << hts_version() << std::endl;
      return 0;
    }
    else if ((std::string(argv[1]) == "help") || (std::string(argv[1]) == "--help") || (std::string(argv[1]) == "-h") || (std::string(argv[1]) == "-?")) {
      printTitle("Delly");
      displayUsage();
      return 0;
    }
    else if ((std::string(argv[1]) == "warranty") || (std::string(argv[1]) == "--warranty") || (std::string(argv[1]) == "-w")) {
      displayWarranty();
      return 0;
    }
    else if ((std::string(argv[1]) == "license") || (std::string(argv[1]) == "--license") || (std::string(argv[1]) == "-l")) {
      bsd();
      return 0;
    }
    else if ((std::string(argv[1]) == "call")) {
      return delly(argc-1,argv+1);
    }
    else if ((std::string(argv[1]) == "lr")) {
      return tegua(argc-1,argv+1);
    }
    else if ((std::string(argv[1]) == "filter")) {
      return filter(argc-1,argv+1);
    }
    else if ((std::string(argv[1]) == "merge")) {
      return merge(argc-1,argv+1);
    }

    std::cerr << "Unrecognized command " << std::string(argv[1]) << std::endl;
    return 1;
}


What I have tried:

input integer and file of char if char less than 2 print Delly other ways return it
Posted
Updated 8-Apr-20 12:53pm

1 solution

Quote:
input integer and file of char if char less than 2 print Delly other ways return it
I can say, you are almost there. When writing a pseudo-code, just start reading the code in plain-English but with indents. :laugh:

Program starts:
    If argument count is more than 2,
        Call printTitle with parameter "Delly"
    ...
    ...
You might notice that some authors use extra characters for notation of if...else and blocks. Some of these characters resemble the programming languages, such as { }.

You are not bound to any structure, just explain the code in plain-English.

Pseudocode - Wikipedia[^]
 
Share this answer
 
v2
Comments
Member 14796573 8-Apr-20 19:01pm    
ok, help me please if you understand this because of my language is very lost.
Rick York 8-Apr-20 22:06pm    
He just did. Read the wikipedia thing, refer to his example, and give it a go.

It is up to YOU to interpret the code and you were just shown how.
Member 14796573 9-Apr-20 16:41pm    
look at this:

#Program starts:
# If argument count is more than 2,
Call print title with parameter "Delly"
# If argument is a version or v print Delly version of programs and number of versions
# if argument is help or h return Delly and list of argument
# if argument is warranty or w return warranty
# if argument is license or l return bsd
# if argument is call return delly call
# if argument is lr return delly lr
# if argument is filter return delly filter
# if argument is merge return delly merge
Afzaal Ahmad Zeeshan 9-Apr-20 20:45pm    
Yes, it makes sense.

Although, you can add more detail to the program by adding indentation and using the parameters and other hardcoded values. Such as, If the second argument is a version or v, then print the Delly version. Something like that so that the user can know what is going on.
Member 14796573 10-Apr-20 13:07pm    
thank you, Prather.
I'm happy :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900