[Chennaipy] Implementation of head using docopt

harsha sunder harshasunder at gmail.com
Sat Nov 8 09:25:59 CET 2014


docopt.txt is just a text document i made to try this program out. its
attached below. And yes, its printing the usage : the quoted string at the
beginning of the python script.
Im using windows 7, python 2.7, and the head.py script and the text
document is in the Python27 directory.the command i enter is

C:\Python27>head.py -c 43 C:\Python27\docopt.txt
and the output i get is

Usage: head [options] [FILE]...

  -c K, --bytes=K        print the first K bytes of each file;
                         with the leading `-', print all but the last
                         K bytes of each file
  -n K, --lines=K        print the first K lines instead of the first 10;
                         with the leading `-', print all but the last
                         K lines of each file [default: 10]
  -q, --quiet, --silent  never print headers giving file names
  -v, --verbose          always print headers giving file names
      --help             display this help and exit
      --version          output version information and exit

I tried the examples that come with docopt and they worked properly.

On Sat, Nov 8, 2014 at 12:21 PM, Vijay Kumar <vijaykumar at bravegnu.org>
wrote:

> On Saturday 08 November 2014 11:35 AM, harsha sunder wrote:
> > hi,
> > not able to figure out how this works. Im trying the following command
> and its only printing out the header message. shouldnt it print out the
> first few bytes of the text document?
> >
> > head.py -c 43 C:\Python27\docopt.txt
>
> I am not sure what you mean by header message. Is it printing the
> usage? Can you paste the output of the command and the contents of
> docopt.txt. Also indicate the exact command line, used to run the
> program.
>
> Regards,
> Vijay
>
> _______________________________________________
> Chennaipy mailing list
> Chennaipy at python.org
> https://mail.python.org/mailman/listinfo/chennaipy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chennaipy/attachments/20141108/503e3537/attachment-0001.html>
-------------- next part --------------
doc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is thisdoc opt is confusing so is this


More information about the Chennaipy mailing list