Installation • Usage • CI Status • Contributing • License
fmtc is a simple utility for rendering fmtc formatted data. You can use it instead of the echo command to print colored messages.
# Simple formatted message
fmtc "{*}Done!{!} File {#87}$file{!} successfully uploaded to {g_}$host{!}"
# Use option -E/--error to print message to stderr
fmtc -E "{r*}There is no user bob{!}"
# You can use stdin as a source of data
echo "{*}Done!{!} File {#87}$file{!} successfully uploaded to {g_}$host{!}" | fmtc
# or
fmtc <<< "{*}Done!{!} File {#87}$file{!} successfully uploaded to {g_}$host{!}"
# You can print message without colors using -nc/--no-color option
fmtc -nc "{*}Done!{!} File {#87}$file{!} successfully uploaded to {g_}$host{!}"
# Also, fmtc supports the NO_COLOR environment variable (https://no-color.org)
NO_COLOR=1 fmtc "{*}Done!{!} File {#87}$file{!} successfully uploaded to {g_}$host{!}"
# You can combine the use of fmtc with HEREDOC to reduce the number of fmtc calls
fmtc << EOF
{*}Usage:{!} rpmbuilder-farm {y}{command}{!} {s}arg…{!}
{*}Basic commands{!}
{y}${CMD_INSTALL}{!} restart-delay{!} Install farm on the system
{y}${CMD_UNINSTALL}{!} Uninstall farm from the system
{y}${CMD_UPDATE}{!} Update all images
{y}${CMD_USER_ADD}{!} {s}user{!} Add new user
{y}${CMD_USER_DEL}{!} {s}user{!} Remove user and it containers
{y}${CMD_USER_MOD}{!} {s}user{!} Modify user public key
{*}Containers commands{!}
{y}${CMD_START}{!} {s}user{!} {s-}image-name{!} Start containers for given user
{y}${CMD_RESTART}{!} {s}user{!} {s-}image-name{!} Restart containers for given user
{y}${CMD_STOP}{!} {s}user{!} {s-}image-name{!} Stop containers for given user
{y}${CMD_START_ALL}{!} Start containers for all users
{y}${CMD_RESTART_ALL}{!} Restart containers for all users
{y}${CMD_STOP_ALL}{!} Stop containers for all users
{*}Options{!}
{g}--help{!}, {g}-h{!} Show this help message
{g}--version{!}, {g}-v{!} Show information about version
EOFTip
If you are using SublimeText 4 (4075+), we strongly recommend that you install extended Bash syntax highlighting with support for fmtc tags.
To build the fmtc from scratch, make sure you have a working Go 1.23+ workspace (instructions), then:
go install github.com/essentialkaos/fmtc@latest
sudo dnf install -y https://pkgs.kaos.st/kaos-repo-latest.el$(grep 'CPE_NAME' /etc/os-release | tr -d '"' | cut -d':' -f5).noarch.rpm
sudo dnf install fmtcYou can download prebuilt binaries for Linux and macOS from EK Apps Repository:
bash <(curl -fsSL https://apps.kaos.st/get) fmtcSince version 1.1.0 you can update fmtc to the latest release using self-update feature:
fmtc --updateThis command will runs a self-update in interactive mode. If you want to run a quiet update (no output), use the following command:
fmtc --update=quietNote
Please note that the self-update feature only works with binaries that are downloaded from the EK Apps Repository. Binaries from packages do not have a self-update feature and must be upgraded via the package manager.
You can generate completion for bash, zsh or fish shell.
Bash:
sudo fmtc --completion=bash 1> /etc/bash_completion.d/fmtcZSH:
sudo fmtc --completion=zsh 1> /usr/share/zsh/site-functions/fmtcFish:
sudo fmtc --completion=fish 1> /usr/share/fish/vendor_completions.d/fmtc.fishYou can generate man page using next command:
fmtc --generate-man | sudo gzip > /usr/share/man/man1/fmtc.1.gz| Branch | Status |
|---|---|
master |
|
develop |
Before contributing to this project please read our Contributing Guidelines.
