Niels Segers

Full Stack Developer at delta.app


Supdock Fuzzy Searching

As of version 2.2.0 I introduced the option to fuzzy search by name for certain commands. Since this would overwrite the default docker behaviour that was intended to always passthrough, I added an option to enable or disable this functionality. Let me explain with an example.

In the normal supdock behaviour I originally intended commands like supdock logs -f to show a prompt with available options when no id or container name was passed.

So when a user passed:

supdock logs -f foobar

It would break the custom functionality and passthrough straight to docker. This made sure supdock wasn't too much of a drastic change to the default docker behaviour.

So coming back to the new fuzzy search. With fuzzy searching enabled you can now search based on a part of the container name like the following: docker logs -f foo. Which then matches your search term foo with the container named foobar. In the versions pre 2.2.0 of supdock it would just passthrough to docker and tell you the foo container didn't exist.

This behaviour is disabled by default and can be enabled by doing the following:

supdock enable fuzzy-search

And can ofcourse be disabled by using:

supdock disable fuzzy-search
Usage: supdock enable [OPTIONS]

Enable certain supdock functionality

Options:
  caution-check (When fuzzy searching is enabled we ask the user for confirmation before we execute the command. Default: enabled)
  fuzzy-search (Disable fuzzy searching. Default: disabled)

The config file is created at:

${HOME}/.supdock/config.json

You can read more about supdock by clicking here.

Written by Niels Segers