Snippets¶
Snippets are curated command examples, prepared for the eRN. Pet is used to implement the feature.
Using snippets¶
The command pet list shows the example commands. Adding the -t argument and
the name of a module shows the commands related to the specific module. If no
commands are shown then no snippets have been added for the module. For example,
pet list -t samtools. The command pet search can be used to fuzzy search for
snippets. Again, the -t argument can be used search only through the module's
examples. Finally, the command pet exec -t samtools runs the selected
Samtools' snippet.
Shell integration¶
Snippets can be run in the shell without using the pet command. Press Ctrl+x
and Ctrl+r, type a query string to search for a snippet. The query string can,
for example, be #samtools which shows the snippets related to the samtools
module. Press Enter, to run the selected snippet. The selected snippets is
placed on the prompt where final changes can be made, before pressing Enter to
run the command.
When the BASH history is searched, using Ctrl+r, new snippets can be created
from the history. Select a command in the history, and press Alt+s to create a
snippet. The snippet can be run using the previously mentioned steps. After a
command completes, a snippet can be created by pressing Ctrl+x and Ctrl+p.
eRN snippets¶
The ufs and ern tags can be used to search for, list, and execute eRN
example commands, some examples:
Shell integration is also available, use the search terms #ufs and #ern.