Metadata-Version: 2.1
Name: pyutok
Version: 1.1.0
Summary: Inspired by a tool I can not find anymore on the internet: utok 1.5. I use it to clean up path settings in large shell script configuration setups.
Home-page: https://python.xn--hllmanns-n4a.de/utok/
License: MIT
Author: Berthold Höllmann
Author-email: berhoel@gmail.com
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: System :: Shells
Classifier: Topic :: Utilities
Requires-Dist: sphinx-argparse (>=0.2.5,<0.3.0)
Project-URL: Documentation, https://www.xn--hllmanns-n4a.de/utok/
Project-URL: Repository, https://gitlab.com/berhoel/python/pyutok.git
Description-Content-Type: text/x-rst


==================================
 pyUTok - Unique TOKens in python
==================================

Inspired by a tool I can not find anymore on the internet: utok 1.5. I
use it to clean up path settings in large shell script configuration
setups.


utok has the following options::


   usage: utok [-h] [--delimiter DELIMITER] [--delete-list DELETE_LIST] [--version] tokens [tokens ...]

   positional arguments:
     tokens

   optional arguments:
     -h, --help            show this help message and exit
     --delimiter DELIMITER, -s DELIMITER
                           Allows one to change the delimiter. If you use csh you might want to set your path with something like: set path = (`utok -s \ /usr/local/bin $path`) (default: :)
     --delete-list DELETE_LIST, -d DELETE_LIST
                           Allows one to remove tokens from a list, to remove /usr/sbin and . from a path in Bourne Shell one might use: PATH=`utok $PATH -d .:/usr/sbin` (default: None)
     --version, -V         show program's version number and exit

Homepage
========

`<https://python.höllmanns.de/utok/>`_

Availability
============

The latest version should be available at my `GitLab
<https://gitlab.com/berhoel/python/pyutok>`_ repository, the package
is avaliable at `pypi <https://pypi.org/project/pyutok/>`_ via ``pip
install pyutok``.

Description
===========

utok, Unique TOKens, takes a list of arguments with delimiters and
reject all duplicate entries. Here is a example using ``MANPATH``:

.. code-block:: shell

    $ echo $MANPATH
    /usr/man:/usr/local/man
    $ MANPATH=`utok /home/local/man /usr/local/man $MANPATH /usr/openwin/man`
    $ export MANPATH
    $ echo $MANPATH
    /home/local/man:/usr/local/man:/usr/man:/usr/openwin/man


Even though ``/usr/local/man`` was included a second time it is only
in the ``MANPATH`` once, though it is now before the ``/usr/man``
entry instead of after it.

This version adds the ``-d`` option to remove tokens. To remove ``.``
from the ``PATH`` one would do the following:

.. code-block:: shell

    $ echo $PATH
    /usr/local/bin:.:/usr/bin:/usr/sbin
    $ PATH=`utok -d .: $PATH`
    $ echo PATH
    /usr/local/bin:/usr/bin:/usr/sbin
    $ export PATH


Requested Features
==================

  * Have a way to to push an element further back in the path. A work
    around of this would be be something like:

    .. code-block:: shell

      utok `utok a:b:c:d -d b` b

    which returns: ``a:c:d:b``

  * Have a way to include multiple ``-s`` options.

Feedback
========

Comments or bug reports/fixes go to Berthold Höllmann <berhoel@gmail.com>.

Copyright © 2020 Berthold Höllmann <berhoel@gmail.com>

Original C version:
Copyright © 1998 Sven Heinicke <sven@zen.org>
