Skip to content

ouser4629/CmdArgLib_Command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CmdArgLib_Command

This repositiory provides three executable programs built using the Command<PhraseFormatter> macro provided by cmd-arg-lib.


Basic Build and Run

Demo> git clone https://github.com/ouser4629/CmdArgLib_Command.git
# output

Demo> cd CmdArgLib_Command/
# output

CmdArgLib_Command> swift build -c release
# output

Now move to a new terminal (i.e., ) and cd to .build/release.

release> ./cf-ca1-simple -h
DESCRIPTION
  Run subcommands

USAGE
  cf-ca1-simple [-th] <subcommand>

OPTIONS
  --generate-fish-completion-script   Print a fish completion script.
  --generate-zsh-completion-script    Print a zsh completion script.
  -t                                  Show a hierarchical list of commands.
  -h/--help                           Show this help screen.

SUBCOMMANDS
  quotes    Print quotes by famous people.
  food      Print food items passed in from the command line.
  files     Print file names passed in from the command line.
release> ./cf-ca1-simple -t
cf-ca1-simple
├── quotes
│   ├── general - print quotes about life
│   └── computing - print quotes about computing
├── food - print food items passed in from the command line
└── files - print file names passed in from the command line


release> ./cf-ca1-simple quotes general -u 1
Quote
  WELL DONE IS BETTER THAN WELL SAID. - BENJAMIN FRANKLIN

Local Installation With Argument Completion

Download and install cal-arg-lib-package-manager.

Make a directory, say Temp, cd to it, and install the programs

Demo> git clone https://github.com/ouser4629/CmdArgLib_Command.git
# output

Demo> cd CmdArgLib_Command/
# output

CmdArgLib_Command> swift build -c release
# output

CmdArgLib_Command> calpm install --shell fish -s zsh
ca1-simple
    installed "ca1-simple" in /Users/po/.local/bin
ca2-stateful
    installed "ca2-stateful" in /Users/po/.local/bin
cf-ca1-simple
    installed "cf-ca1-simple" in /Users/po/.local/bin
    installed "cf-ca1-simple.fish" in /Users/po/.config/fish/completions
    installed "_cf-ca1-simple" in /Users/po/.config/zsh/completions
cf-ca2-stateful
    installed "cf-ca2-stateful" in /Users/po/.local/bin
    installed "cf-ca2-stateful.fish" in /Users/po/.config/fish/completions
    installed "_cf-ca2-stateful" in /Users/po/.config/zsh/completions

Now move to a new terminal (i.e., ) and move back to Demo (i.e., cd ..).

You can now try it out, including command line completion:

Demo> > cf-ca1-simple -h
DESCRIPTION
  Run subcommands

USAGE
  cf-ca1-simple [-th] <subcommand>

OPTIONS
  --generate-fish-completion-script   Print a fish completion script.
  --generate-zsh-completion-script    Print a zsh completion script.
  -t                                  Show a hierarchical list of commands.
  -h/--help                           Show this help screen.

SUBCOMMANDS
  quotes    Print quotes by famous people.
  food      Print food items passed in from the command line.
  files     Print file names passed in from the command line.
Demo> cf-ca1-simple -t
cf-ca1-simple
├── quotes
│   ├── general - print quotes about life
│   └── computing - print quotes about computing
├── food - print food items passed in from the command line
└── files - print file names passed in from the command line


[I] Demo> cf-ca1-simple quotes general -u 1
Quote
  WELL DONE IS BETTER THAN WELL SAID. - BENJAMIN FRANKLIN

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages