Count the number of lines of text in a code project (or anything else)
Version: 0.7.21
--
xlines requires Python 3.6+.
If your environment has Python 3.5 or older or is missing Python 3 altogether, consider using nlines as an excellent alternative. nlines bash implementation line counter is compatible with virtually any Linux-based development environment.
To display the xlines help menu:
$ xlines --help
--
GNU Make Targets. Type the following to display the available make targets from the root of the project:
$ make help
--
Configure xlines runtime options by entering the configuration menu:
$ xlines --configure
--
Option "A" (shown below) allows addition of file types to be excluded (skipped) from line totals
--
Option "B" (shown below) allows deletion of file types from the exclusion list so that a specific file extension will be included in total line counts:
--
Option "C" (shown below) allows user-customization of files highlighted for containing a large number of lines of text:
--
xlines may be installed on Linux via pip, python package installer in one of two methods:
To install xlines for a single user:
$ pip3 install xlines --user
To install xlines for all users (Linux):
$ sudo -H pip3 install xlines
The easiest way to install xlines on debian-based Linux distributions is via the debian-tools package repository:
-
Open a command line terminal.
-
Download and install the repository definition file
$ sudo apt install wget
$ wget http://awscloud.center/deb/debian-tools.list
$ sudo chown 0:0 debian-tools.list && sudo mv debian-tools.list /etc/apt/sources.list.d/
-
Install the package repository public key on your local machine
$ wget -qO - http://awscloud.center/keys/public.key | sudo apt-key add -
-
Update the local package repository cache
$ sudo apt update
-
Install xlines os package
$ sudo apt install python3-xlines
Answer "y":
-
Verify Installation
$ apt show python3-xlines
The easiest way to install xlines on redhat-based Linux distributions is via the developer-tools package repository:
-
Open a command line terminal.
-
Install the official epel package repository
$ sudo yum install epel-release
-
Download and install the repo definition file
$ sudo yum install wget
$ wget http://awscloud.center/rpm/developer-tools.repo
$ sudo chown 0:0 developer-tools.repo && sudo mv developer-tools.repo /etc/yum.repos.d/
-
Delete the local repository cache, then Update the cache with new package references
$ sudo rm -fr /var/cache/yum $ sudo yum update -y
-
Install the python3-xlines os package
$ sudo yum install python36-xlines
Answer "y":
-
Verify Installation
$ yum info python36-xlines
The easiest way to install xlines on redhat-based Linux distribution Amazon Linux 2 or Fedora, is via the developer-tools amzn2.awscloud.center package repository:
-
Install the official epel package repository
$ sudo amazon-linux-extras install epel -y
-
Download and install the repo definition file
$ sudo yum install wget
$ wget http://awscloud.center/amzn2/developer-tools.repo
$ sudo chown 0:0 developer-tools.repo && sudo mv developer-tools.repo /etc/yum.repos.d/
-
Delete the local repository cache, then Update the cache with new package references
$ sudo rm -fr /var/cache/yum $ sudo yum update -y
-
Install xlines os package
$ sudo yum install python37-xlines
Answer "y":
-
Verify Installation
$ yum info python37-xlines
A check of python3 should point to Python 3.7:
$ python3 --version
$ Python 3.7.X
--
$ xlines --sum git/branchdiff
All works contained herein copyrighted via below author unless work is explicitly noted by an alternate author.
- Copyright Blake Huber, All Rights Reserved.
- Software contained in this repo is licensed under the license agreement. You may display the license and copyright information by issuing the following command:
$ xlines --version
Code is provided "as is". No liability is assumed by either the code's originating author nor this repo's owner for their use at AWS or any other facility. Furthermore, running function code at AWS may incur monetary charges; in some cases, charges may be substantial. Charges are the sole responsibility of the account holder executing code obtained from this library.
Additional terms may be found in the complete license agreement.