Command Argument Library Tool

Overview

Projects with a CLI often end up repeatedly rebuilding the same infrastructure:

  • help screens
  • shell completions
  • manual pages
  • installation
  • testing
  • command hierarchy structure

caltool tries to make those pieces available immediately through templates , and a support fast edit/build/install/test cycle during CLI development.

Example

caltool init --with-completion --directory MyTool --template testing
cd MyTool
swift test
swift build -c release
caltool install -s zsh fish

This generates and installs a complete CLI package, ready for adaptation to your own project, with:

  • typed command-line argument definitions
  • generated help screens
  • shell completions
  • unit tests

Subcommands

caltool provides three subcommands: init, install and uninstall.
caltool init generates realistic examples that you can edit to suit your needs
caltool install and caltool uninstall manage local installation of: executables, shell completions and manpages

caltool bootstrapping itself

> caltool install -s fish zsh -m caltool caltool/init caltool/install caltool/uninstall
__cal_fish_completion_tool
    installed "__cal_fish_completion_tool" in /Users/po/.local/bin
caltool
    installed "caltool" in /Users/po/.local/bin
    installed "caltool.fish" in /Users/po/.config/fish/completions
    installed "_caltool" in /Users/po/.config/zsh/completions
    installed "caltool.1" in /Users/po/.local/share/man/man1
    installed "caltool-init.1" in /Users/po/.local/share/man/man1
    installed "caltool-install.1" in /Users/po/.local/share/man/man1
    installed "caltool-uninstall.1" in /Users/po/.local/share/man/man1

Repository:

Command Argument Library Tool

1 Like