Thread: Setting up a usage message cmd

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Oh, you mean something like this?
    Code:
    mycmd -h
    mycmd --help
    You have to make your program output the message you want when the user gives "-h" or "--help" through the command line. There are independent programs that display helpful information, such as "man" for linux.

    The simpler implementation for what you want, albeit ad-hoc, is something like the following:
    Code:
    // Inside a loop
    if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) {
        puts("Helpful message!");
    }
    Last edited by GReaper; 10-07-2017 at 05:50 PM.
    Devoted my life to programming...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. VC++ 6 - CPU Usage Help
    By solem1 in forum C Programming
    Replies: 0
    Last Post: 09-08-2009, 11:16 PM
  2. CPU usage
    By sandy143 in forum C Programming
    Replies: 3
    Last Post: 07-13-2007, 07:16 AM
  3. anyone help me on usage of this
    By black in forum C++ Programming
    Replies: 8
    Last Post: 05-24-2004, 08:25 PM
  4. 99% CPU Usage...
    By napkin111 in forum Game Programming
    Replies: 27
    Last Post: 03-04-2003, 11:37 AM
  5. Replies: 4
    Last Post: 01-06-2002, 06:22 PM

Tags for this Thread