Skip to content

Variables for arguments in aliases #9

@heades

Description

@heades

Be able to add variables within aliases where additional arguments are placed when running.

For example, if I want to run the following command as an alias:

find src -name "*.hs" | xargs wc -l

But, I want to vary the directory I'm searching and the pattern I'm searching for to make this alias more generic. So we could add new variables:

bk add alias count-lines='find $1 -name "$2" | xargs wc -l'

(I'm not sure of the best syntax for variables yet)

This would place the first argument to the alias as the directory we are searching for and the second argument as the pattern. This would make writing reusable aliases a lot easier!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions