Package: pyfunky
funkyFunky takes shell functions to the next level by making them easier to define, more flexible, and more interactive.Table of ContentsUsageLocal vs GlobalFunk Definition ShortcutsSpecial cd FunksSimulate Shell VariablesThe "$@" Special ParameterArticles / Blog PostsInstallationUsing pip to InstallBuilding from SourceSimilar ProjectsContributionsUsageFunks are manipulated using thefunkyandgfunkycommands. These commands have the same user interface, which is specified in theCommand-line Interfacesection. The difference between the two commands is treated in theLocal vs Globalsection.Local vs GlobalLocalfunks are stored using a hidden database file that is located in the same directory
where the funk was created. These can be manipulated using the action command options described
above. Once created, a local funk can be used just like any other command or normal funk---as
long as you have activated the provided shell extension (seeAdditional Install Steps) and are
inside of the directory where the local funk was originally defined.Globalfunks, on the other hand, are stored in your home directory (/home/<user>) and can
be used from any directory. Local funks can be used to override global funk definitions.Local and global funks can be manipulated (created, removed, edited, renamed, etc.) by using thefunkyandgfunkycommands, respectively.Funk Definition ShortcutsNormally when defining a funk, the provided raw definition (the final contents of the temp file) is inserted directly into the generated function definition. However, funky does try to make some alterations to the original funk definition when doing so is convenient. Thesefunky definition shortcutscan make defining funks faster:SpecialcdFunksA funk definition of the form@./relative/path/to/directorywill be automatically changed tocd/absolute/path/to/directory/"$@"||return1Simulate Shell VariablesA funk definition of the form"Some string here..."will be automatically changed toecho"Some string here...""$@"This allows you to use funks to simulate shell variables viacommand substitution.The "$@" Special ParameterThis project originally used aliases. The decision to migrate to shell functions was made based on
the fact that shell functions are far more capable than aliases. Moreover, there is very little
benefit to using aliases over shell functions.With that said, actual aliases do have one appeal over shell functions. When you use an alias, any
arguments that you pass to it are automatically passed to the command definition (at runtime,
aliases are just substituted with their definitions). For the purpose of emulating this behavior
when it would typically be desired, a funk defined using asingle-linecommand definition
thatdoes NOT already contain argument variables(e.g. does not contain$0,$1, ...,$9,$*, or$@) will automatically have the"$@"special parameter appended to its
definition. This allows for the same automatic argument handling that you would expect from an
alias.See the officialBash docsfor more information on Bash's special parameters.Articles / Blog PostsWith the goal of listing alternative sources of documentation / tutorials, this
section will be used to track any articles or blog posts which mention funky:6 Command Line Tools for Productive Programmers(2021-07-23)InstallationUsingpipto InstallTo install funky, run the following commands in your terminal (replaceSHELLwith eitherbashorzsh):python3-mpipinstall--userpyfunky# install funkypython3-mfunky--setup-shellSHELL# hook funky into your shellThis is the preferred method to install funky, as it will always install the most recent stable release.If you don't havepipinstalled, thisPython installation guidecan guide
you through the process.Building from SourceYou can either clone the public repository:$gitclonegit://github.com/bbugyi200/funkyOr download thetarball:$curl-OLhttps://github.com/bbugyi200/funky/tarball/masterOnce you have a copy of the source, you can install funky by running:makeinstallThe last thing you need to do is hook funky into your shell of choice, which
can be accomplished with the following command (replaceSHELLwith eitherbashorzsh):python3-mfunky--setup-shellSHELLSimilar Projectsdesk- A lightweight workspace manager for the shell.smartcd- Alter your bash (or zsh) environment as you cd.direnv- is an extension for your shell. It augments existing shells with a new feature that can load and unload environment variables depending on the current directory.ContributionsPull requests are welcome. SeeCONTRIBUTING.mdfor more information.