code: def less(args):
      
      from jcvi.formats.base import must_open
  
      p = OptionParser(less.__doc__)
      opts, args = p.parse_args(args)
  
      if len(args) != 2:
          sys.exit(not p.print_help())
  
      filename, pos = args
      fsize = getfilesize(filename)
  
      if pos == "all":
          pos = [x / 10. for x in range(0, 10)]
      else:
          pos = [float(x) for x in pos.split(",")]
  
      if pos[0] > 1:
          pos = [x / fsize for x in pos]
  
      if len(pos) > 1:
          counts = 20
      else:
          counts = None
  
      fp = must_open(filename)
      for p in pos:
          snapshot(fp, p, fsize, counts=counts)
docs: %prog less filename position | less
  
      Enhance the unix `less` command by seeking to a file location first. This is
      useful to browse big files. Position is relative 0.00 - 1.00, or bytenumber.
  
      $ %prog less myfile 0.1      # Go to 10% of the current file and streaming
      $ %prog less myfile 0.1,0.2  # Stream at several positions
      $ %prog less myfile 100      # Go to certain byte number and streaming
      $ %prog less myfile 100,200  # Stream at several positions
      $ %prog less myfile all      # Generate a snapshot every 10% (10%, 20%, ..)