Enum conch_parser::ast::ParameterSubstitution [] [src]

pub enum ParameterSubstitution<P, W, C, A> {
    Command(Vec<C>),
    Len(P),
    Arith(Option<A>),
    Default(bool, P, Option<W>),
    Assign(bool, P, Option<W>),
    Error(bool, P, Option<W>),
    Alternative(bool, P, Option<W>),
    RemoveSmallestSuffix(P, Option<W>),
    RemoveLargestSuffix(P, Option<W>),
    RemoveSmallestPrefix(P, Option<W>),
    RemoveLargestPrefix(P, Option<W>),
}

A parameter substitution, e.g. ${param-word}.

Generic over the representations of parameters, shell words and commands, and arithmetic expansions.

Variants

Returns the standard output of running a command, e.g. $(cmd)

Returns the length of the value of a parameter, e.g. ${#param}

Returns the resulting value of an arithmetic subsitution, e.g. $(( x++ ))

Use a provided value if the parameter is null or unset, e.g. ${param:-[word]}. The boolean indicates the presence of a :, and that if the parameter has a null value, that situation should be treated as if the parameter is unset.

Assign a provided value to the parameter if it is null or unset, e.g. ${param:=[word]}. The boolean indicates the presence of a :, and that if the parameter has a null value, that situation should be treated as if the parameter is unset.

If the parameter is null or unset, an error should result with the provided message, e.g. ${param:?[word]}. The boolean indicates the presence of a :, and that if the parameter has a null value, that situation should be treated as if the parameter is unset.

If the parameter is NOT null or unset, a provided word will be used, e.g. ${param:+[word]}. The boolean indicates the presence of a :, and that if the parameter has a null value, that situation should be treated as if the parameter is unset.

Remove smallest suffix pattern from a parameter's value, e.g. ${param%pattern}

Remove largest suffix pattern from a parameter's value, e.g. ${param%%pattern}

Remove smallest prefix pattern from a parameter's value, e.g. ${param#pattern}

Remove largest prefix pattern from a parameter's value, e.g. ${param##pattern}

Trait Implementations

impl<P: Debug, W: Debug, C: Debug, A: Debug> Debug for ParameterSubstitution<P, W, C, A>
[src]

Formats the value using the given formatter.

impl<P: PartialEq, W: PartialEq, C: PartialEq, A: PartialEq> PartialEq for ParameterSubstitution<P, W, C, A>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<P: Eq, W: Eq, C: Eq, A: Eq> Eq for ParameterSubstitution<P, W, C, A>
[src]

impl<P: Clone, W: Clone, C: Clone, A: Clone> Clone for ParameterSubstitution<P, W, C, A>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more