4 releases (breaking)
|0.7.0||Mar 12, 2022|
|0.6.0||Mar 10, 2022|
|0.2.0||Feb 25, 2022|
|0.1.0||Feb 24, 2022|
#1691 in Command line utilities
File-aware dynamic command runner.
Xf try to find a file from the current directory and upwards, and execute different command according to the different file found.
cargo install xf
Binaries on macOS, Linux, Windows
Download from Github Releases, unzip and add xf to your $PATH.
Xf loads rules from configuration file.
The default path of configuration file is
$HOME/.xf, which can be specified with the
Rule format is:
xf what file to find,
xf what command to execute if found.
xfhas a built-in lowest priority rule:
Xfile: $file $@
Configure the following rules:
Taskfile: bash $file $@
xf try to find for
Taskfile file in the current directory, and if found, execute
bash $file foo .
If not found, continue finding for
Xfile file in the current directory, if found, execute
Xfile foo (built-in rule).
If not found, enter the parent directory to continue this process.
File matching rules:
Xfilecan match files
Find the filename that contains the rule filename.
Xfilecan match the files
The following built-in variables can be used in the command part of rule.
$@- pass-through command line parameters
$file- file path
$fileDir- file directory, process's cwd will be set to this value
$currentDir- the current directory
$@) are also synced to environment variables:
Actually, the command name affect builtin-rule and environment variable prefix.
If you rename executable file
The built-in rule will be
Taskfile: $file $@
The default configuration file path will be
The environment variable
The environment variable for
Copyright (c) 2022 xf-developers.
argc is made available under the terms of either the MIT License or the Apache License 2.0, at your option.
See the LICENSE-APACHE and LICENSE-MIT files for license details.