Skip to content

Compdoc

Timothée Mazzucotelli edited this page Oct 25, 2017 · 5 revisions

Comprehensive documentation


shellm

WIP


shellm subcommands

WIP


daemon

shellm-daemon - wrapper for daemon (see lib/core/daemon)

Usage

shellm-daemon start|stop|kill DAEMONS
shellm-daemon [un]register DAEMONS
shellm-daemon startall|stopall|killall
shellm-daemon alias NAME [COMMANDS...]
shellm-daemon runalias NAME

Start and stop daemons written with core/daemon/* libraries.

Options

  • start DAEMON [ARGS...]: Start a daemon.
  • stop DAEMON: Stop a daemon (will wait for its current execution to finish).
  • kill DAEMON [SIGNAL]: Immediatly terminate a daemon (will send a TERM signal by default). The SIGNAL argument will be fed to kill.
  • register DAEMONS: Remember these daemons to work with all options.
  • unregister DAEMONS: Forget these daemons. They wont work with all options anymore.
  • startall [ARGS...]: Start all daemons, with optional ARGS.
  • stopall Stop all daemons.:
  • killall [SIGNAL]: Kill all daemons with SIGNAL (default to TERM).
  • alias NAME [COMMANDS...]: If COMMANDS are given, define a new alias named after NAME. If no COMMANDS are given, print the contents of alias NAME.
  • runalias NAME: Run the commands in alias defined by NAME.
  • help, -h, --help: Prints this help and exit.

Examples

  • dae start reencode: Start the daemon called reencode. You can then stop it with stop reencode or kill it with kill reencode.
  • dae alias D1 "kill reencode" "start normalize": Define an alias called D1 which will kill reencode daemon then start normalize daemon when called.
  • dae runalias D1: Call the D1 alias and run its commands.

debug

shellm-debug - shell script debugger

Usage

shellm-debug [-tvn] SCRIPT | -h

Run a script in path with the -x bash option (and more). You should set the PS4 variable for better output.

Options

  • -t, --test: Read the script and warn for encountered syntax errors. Do not actually run the script.
  • -v, --verbose: Run the script with verbose option.
  • -n, --dry-run: Options test and verbose combined. Validate the syntax and print the script to stdout.
  • -h, --help: Prints this help and exit.

Environment variables

  • PS4: Debugger prompt. This is the prefix that bash prepends to the current instruction when using -x option. Example: PS4='°\033[;37m(\033[;1;36m${BASH_SOURCE##*/}\033[;37m:\033[;1;34m${LINENO}\033[;37m):\033[;0;39m${FUNCNAME[0]}> ' (without colors: PS4='°(${BASH_SOURCE##*/}:${LINENO}):${FUNCNAME[0]}> ').

init

WIP


install-requirements

shellm-install-requirements - Install the listed requirements for the given script

Usage

shellm-install-requirements FILENAME

Options

  • -h, --help: Prints this help and exit
  • -m, --missing: Try to install missing requirements only

load

WIP


new

shellm-new - creates a new script in your shellm/usr/bin directory

Usage

shellm-new FILENAME [TEMPLATE] | -h

This script creates a new file in your shellm/usr/bin directory, makes it executable, writes some lines in it, like the shebang #!/bin/bash, documentation lines and others, then opens it for you to write the rest of the code.

Options

  • -h, --help: Prints this help and exit

run

shellm-run - Load shellm then run a script.

Usage

shellm-run script args