Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ one directive per line, `#` are comments
# keeping variables inherited from parent .cade layers
pure

# stop the cascade here; no parent .cade layers load above this dir
disinherit

# load from flake (default shell or named installable)
load
load flake
Expand Down
9 changes: 9 additions & 0 deletions src/cli/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ impl FromStr for Keyword {

let res = match keyword.as_str() {
"pure" => Pure,
"disinherit" => Disinherit,
"call" => {
// split respecting shell quoting
let target = shlex::split(rest_raw).ok_or(ParseError::InvalidQuoting)?;
Expand Down Expand Up @@ -181,6 +182,14 @@ mod tests {
));
}

#[test]
fn bare_disinherit_parses() {
assert!(matches!(
"disinherit".parse::<Keyword>(),
Ok(Keyword::Disinherit)
));
}

#[test]
fn keyword_with_equals_in_args_stays_a_keyword() {
// the `=` belongs to the hook command, not a bare assignment
Expand Down
Loading
Loading