Skip to main content

Module args_parser

Module args_parser 

Source
Expand description

Argument Parser for start-command wrapper options

Supports two syntax patterns:

  1. $ [wrapper-options] – [command-options]
  2. $ [wrapper-options] command [command-options]

Wrapper Options: –isolated, –isolation, -i Run in isolated environment (screen, tmux, docker, ssh) –attached, -a Run in attached mode (foreground) –detached, -d Run in detached mode (background) –session, -s Session name for isolation –image Docker image (optional, defaults to OS-matched image) –volume, -v host:container[:mode] Docker bind mount/volume (repeatable, docker only) –mount Docker –mount spec (repeatable, docker only) –env, -e <KEY=VALUE> Environment variable for docker container (repeatable, docker only) –privileged Run docker container in privileged mode (docker only) –network Connect docker container to a named network (docker only) –network-alias Add a network-scoped alias (repeatable, docker only) –endpoint SSH endpoint (required for ssh isolation, e.g., user@host) –isolated-user, -u [username] Create isolated user with same permissions –keep-user Keep isolated user after command completes –keep-alive, -k Keep isolation environment alive after command exits –auto-remove-docker-container Always remove docker container after exit (compatibility alias) –always-cleanup-container Always remove docker container after exit –keep-container Keep docker container filesystem after exit –keep-container-on-fail Remove successful docker containers, keep failed or OOM-killed ones –shell Shell to use in isolation environments: auto, bash, zsh, sh (default: auto) –status Show status of a tracked execution –list List all tracked command executions –upload-log Upload the stored log for a tracked execution –stop Ask a detached execution to stop gracefully –terminate Terminate a detached execution immediately

Structs§

ParsedArgs
Result of parsing arguments
WrapperOptions
Wrapper options parsed from command line

Constants§

VALID_BACKENDS
Valid isolation backends
VALID_OUTPUT_FORMATS
Valid output formats for query output
VALID_SHELLS
Valid shell options for –shell

Functions§

generate_session_name
Generate a unique session name
generate_uuid
Generate a UUID v4
get_effective_mode
Get the effective mode for isolation Multiplexers default to attached, docker defaults to attached
has_isolation
Check if any isolation options are present
is_valid_uuid
Check if a string is a valid UUID v4
parse_args
Parse command line arguments into wrapper options and command
validate_options
Validate parsed options and apply defaults