Easy Launcher For (the) Shell
Project description
Easy Launcher For the Shell (temporary name)
Install from PyPI
pip install elfs
Install from source
python setup.py install --user
Command Line Interface
usage: elfs [options] [command [initial-arguments ...]]
Easy Launcher For (the) Shell
optional arguments:
-h, --help show this help message and exit
-c add the command to your spellbook
-cc name desc rs add the command to your spellbook with comments
-d path add a directory path to your config
-e .ext path add an extension and the path to an executable for it
-l, --list list entire collection (or specify: cmd, dir, ext, files)
-s, --search search entire collection for command
-n, --dry-run print command instead of executing it
Usage Notes
- Runs on any platform with python 3
- Unless using search (and select), the default behaviour is to find a command using exact matches only, and is selected in the following order of precedence
- files in order of directories listed in config
- names of commands from spellbook in order listed
- imply file extension if possible and unambiguous
- Commands without names (or duplicate names of lower precedence) can only be run via search
- Commands and files with spaces in their names need to be escaped or in quotes
- The first argument (that is not an option for elfs) is treated as the command or filename and all subsequent arguments are passed to the command or file to be executed (except for commands with a replace-str, see example)
- Pipes work as expected, you can pipe into or out from any command or file, however if you try piping into a search, it will interpret that as your selection
Examples
- add a directory
> elfs -d ~/scripts
- run your script from any directory
> elfs myscript.py arg0 arg1 arg2
- file extension is implied only if unambiguous
> elfs myscript arg0 arg1 arg2
- add an extension to run a file with a specific executable
> elfs -e .py /path/to/alternative/env/for/python
- add a command
> elfs -cc spam "echo spam to output 3 times" "" echo spam spam spam
- run the command
> elfs spam
spam spam spam
- add a command with a replace-str (metavar: rs) and run it
> elfs -cc menu "even more spam" {} echo spam {} spam {}
> elfs menu bacon eggs
spam bacon spam eggs
- giving fewer arguments causes them to repeat
> elfs menu bacon
spam bacon spam bacon
- and extra arguments are passed along as normal
> elfs menu bacon eggs sausage spam
spam bacon spam eggs sausage spam
- command chaining (needs to run in a shell, elfs uses Popen shell=False)
> elfs -cc "double spam" "" "" bash -c "echo spam && echo spam"
> elfs "double spam"
spam spam
- see the command without running it (quotes may appear slightly different)
> elfs -n "double spam"
Command: bash -c "echo spam && echo spam"
- list all commands and files
> elfs -l
- search commands and files with fuzzy matches, then optionally select from a list of matches to execute
> elfs -s dble spam
- add a command to quickly edit your config
> elfs -cc "config" "" "" nano ~/.config/elfs/config.json
- or add a command to edit your spellbook (you can move this file)
> elfs -cc "spells" "" "" nano ~/.config/elfs/spellbook.json
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
elfs-1.0.0.tar.gz
(6.5 kB
view details)
File details
Details for the file elfs-1.0.0.tar.gz
.
File metadata
- Download URL: elfs-1.0.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c44027e4327769276b7fcca3356aae9e052de99c7438e915ec932400d952fd7 |
|
MD5 | 008b0cf4914a7dc186baf4b813b15a88 |
|
BLAKE2b-256 | 78be179ffeb3c002e8d6391943933e9a16b5f032e3a088e0e2c1e7e4b5e017c4 |