Thread: usage <options>

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    15

    usage <options>

    Hi,
    i am relatively new to programming. i am trying to use an open source library found by google search. the readme file tells to write make on commandline, as a result i got an exe file sample, but now i am trying to chk the output and the usage is:
    USAGE Usage: sample <options>options:
    -c : Encode input file to output file.
    -d : Decode input file to output file.
    -k [1-7] : Length of binary portion.
    -i <filename> : Name of input file.
    -o <filename> : Name of output file.
    -h|? : Print out command line options.
    -c Compress the specified input file (see -i) using the Lempel-Ziv-Welch encoding algorithm. Results are written to the specified output file (see -o).
    -d Decompress the specified input file (see -i) using the Lempel-Ziv-Welch decoding algorithm. Results are written to the specified output file (see -o). Only files compressed by this program may be decompressed.
    -k [1-7] The number of bits in the binary portion of a Rice encoded value.
    -i <filename> The name of the input file. There is no valid usage of this program without a specified input file.
    -o <filename> The name of the output file. If no file is specified, stdout will be used.

    NOTE: Sending compressed output to stdout may produce undesirable results.
    i think i sholud give the command ./sample -c -4 -input.txt -output.txt
    but i am getting an error. the error gives description of usuage, which means i ma doing something wrong.
    any help is appreciated.additionally, if anyone can refer me to some document describing how to give such commands i will be grateful.
    Last edited by amnakhan786; 12-02-2012 at 04:46 AM.

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    That command line will read input from a file named nput.txt and write to a file named utput.txt (assuming, in the processing of options, that it doesn't demand separation between -i/o and the filename).
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  3. #3
    Registered User
    Join Date
    Nov 2011
    Posts
    15
    Quote Originally Posted by grumpy View Post
    That command line will read input from a file named nput.txt and write to a file named utput.txt (assuming, in the processing of options, that it doesn't demand separation between -i/o and the filename).
    thanks for the reply, but can u plz elaborate. i gave the command
    Code:
    ./sample -c(compress) -4 (value of k) -1.txt(input file) -2.txt(output file)
    but error message says:
    Code:
    Error: k must be between 1 and 7.
    Usage: sample <options>
    
    Options:
      -c : Encode input file to output file.
      -d : Decode input file to output file.
      -k [1-7]: Length of binary portion.
      -i <filename> : Name of input file.
      -o <filename> : Name of output file.
      -h | ?  : Print out command line options.
    i dont understand where i am wrong. how do i give option for encode and value for k

    thanks

  4. #4
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    My guess would be "./sample -c -k 4 -i 1.txt -o 2.txt"
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 3 of 8 options
    By apolochaves in forum C Programming
    Replies: 5
    Last Post: 08-01-2010, 05:41 PM
  2. Is there really a better of the two options I have?
    By Shamino in forum C++ Programming
    Replies: 5
    Last Post: 12-26-2007, 08:37 AM
  3. g++ compile options
    By cybernike in forum Linux Programming
    Replies: 2
    Last Post: 07-05-2007, 12:09 AM
  4. 2 options.... which way should I go?
    By CodeMonkey in forum Game Programming
    Replies: 9
    Last Post: 03-18-2002, 09:20 PM

Tags for this Thread