module cli.tail_cli

Short summary

module pyensae.cli.tail_cli

Wrapper function file_tail() into a command line.



truncated documentation


Takes the last lines from a file using function file_tail().


Wrapper function file_tail into a command line.

New in version 1.5.

source on GitHub

pyensae.cli.tail_cli.file_tail_cli(fLOG=<built-in function print>, args=None)

Takes the last lines from a file using function file_tail.

  • fLOG – logging function

  • args – to overwrite sys.args

extract the last lines of a file

Extracts the first line of a file.

file_tail_cli –help

usage: file_tail [-h] [-f FILENAME] [-n NBLINE] [-e ENCODING] [-t THRESHOLD]
                 [-er ERRORS]

Extracts the first nbline of a file (assuming it is text file).

optional arguments:
  -h, --help            show this help message and exit
  -f FILENAME, --filename FILENAME
                        filename (default: None)
  -n NBLINE, --nbline NBLINE
                        number of lines (default: 10)
  -e ENCODING, --encoding ENCODING
                        encoding (default: utf8)
  -t THRESHOLD, --threshold THRESHOLD
                        if the file size is above, it will not read the
                        beginning (default: 16384)
  -er ERRORS, --errors ERRORS
                        see open (default: strict)

source on GitHub