Skip to content

ouser4629/CmdArgLib_Command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CmdArgLib_Command

This repositiory contains a pair of command line tools built using the Command<T> macro provided by cmd-arg-lib.

  • cf1-simple - a simple command tree
  • cf2-stateful - a stateful command tree with a test suiit

Both tools can generate completion scripts for fish and zsh.


Usage

It is recommended to download and install caltool. The caltool utility makes it easy to build, install, and uninstall command line tools built using cmd-arg-lib.

Clone and Build CmdArgLib_Command
> rm -rf Demo && mkdir Demo && cd Demo
Demo> git clone https://github.com/ouser4629/CmdArgLib_Command.git
Demo> cd CmdArgLib_MainFunction
> swift build -c release
...
Run Tests
> CmdArgLib_Command> swift test
...
✔ Test run with 9 tests in 4 suites passed after 0.001 seconds.
Install CmdArgLib_Command Products Locally
CmdArgLib_Command> caltool install -s fish zsh  
cf1-simple
    installed "cf1-simple" in /Users/po/.local/bin
    installed "cf1-simple.fish" in /Users/po/.config/fish/completions
    installed "_cf1-simple" in /Users/po/.config/zsh/completions
cf2-stateful
    installed "cf2-stateful" in /Users/po/.local/bin
    installed "cf2-stateful.fish" in /Users/po/.config/fish/completions
    installed "_cf2-stateful" in /Users/po/.config/zsh/completions
Run Selected Tools
CmdArgLib_Command> cf1-simple -h
DESCRIPTION
  Show quotes and recommended books.

USAGE
  [-ht] <subcommand>

OPTIONS
  -t/--tree             Show a hierarchical list of commands.
  -h/--help             Show this help screen.
  -v/--version          Show the version.

SUBCOMMANDS
  quotes    Print quotes by famous people.
  books     Print a list of recommended books.
CmdArgLib_Command> cf1-simple -t
> cf1-simple -t
cf1-simple
├── quotes
│   ├── general - print quotes about life
│   └── computing - print quotes about computing
└── books - print a list of recommended books
CmdArgLib_Command> cf1-simple quotes general -u 1
QUOTE
  SIMPLICITY IS COMPLEXITY RESOLVED. - CONSTANTIN BRANCUSI
CmdArgLib_Command> cf2-stateful -u books 1
BOOK
  THE GRAPES OF WRATH - JOHN STEINBECK (1939)
Try Completion ScriptsMove to a new terminal and new directory. Run some examples, pressing <TAB> to complete.

Uninstall Products
CmdArgLib_Command> caltool uninstall
cf1-simple
    uninstalled "cf1-simple" in /Users/po/.local/bin
    uninstalled "cf1-simple.fish" in /Users/po/.config/fish/completions
    uninstalled "_cf1-simple" in /Users/po/.config/zsh/completions
cf2-stateful
    uninstalled "cf2-stateful" in /Users/po/.local/bin
    uninstalled "cf2-stateful.fish" in /Users/po/.config/fish/completions
    uninstalled "_cf2-stateful" in /Users/po/.config/zsh/completions

If you ar not in the CmdArgLib_Command directory, you can uninstall using product names:

CmdArgLib_Command> caltool uninstall cf1-simple cf2stateful

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages