Module ds.symbols

Special symbols and their meanings.

Global variables

var ARG_OPTION

Implicit start of task arguments.

var ARG_BEG

Explicit start of task arguments.

var ARG_END

Explicit end of task arguments.

var ARG_PREFIX

Prefix of an interpolated argument.

var ARG_REST

Interpolate remaining arguments.

var GLOB_ALL

Match all current values.

var GLOB_EXCLUDE

Prefix to exclude a glob match.

var GLOB_DELIMITER

Separator between globs.

var KEY_DELIMITER

Separator between key parts.

var KEY_MISSING

Sentinel for missing key.

var SHELL_CONTINUE

Line continuation.

var SHELL_TERMINATORS

No line continuation needed after these.

var SHELL_BREAK

Prefer line breaks after these.

var TASK_COMPOSITE

Composite task name.

var TASK_DISABLED

Prefix of a disabled task.

var TASK_KEEP_GOING

Prefix of an error-suppressed task.

var TASK_SHARED

Shared options task name.

Functions

def starts(haystack: str, needle: str) ‑> Tuple[bool, str]

Return whether haystack starts with needle and a stripped version.

>>> starts("!foo", "!") == (True, "foo")
True
>>> starts("foo", "!") == (False, "foo")
True
def ends(haystack: str, needle: str) ‑> Tuple[bool, str]

Return whether haystack ends with needle and a stripped version.

>>> ends("foo", "oo") == (True, "f")
True
>>> ends("foo", "-") == (False, "foo")
True
def peek_start(haystack: str, *needles: str) ‑> str

Return the first needle starts haystack.

>>> peek_start("abc", "a", "b", "c")
'a'
>>> peek_start("abc", "x")
''
def peek_end(haystack: str, *needles: str) ‑> str

Return the first needle that ends haystack.

>>> peek_end("abc", "a", "b", "c")
'c'
>>> peek_end("abc", "x")
''