Skip to content

Alias expansion not implemented #355

@chaliy

Description

@chaliy

Description

Alias definition and expansion are not implemented. All 15 alias tests are skipped.

Scope

  • alias name='value' - define alias
  • unalias name - remove alias
  • unalias -a - remove all aliases
  • alias (no args) - list all aliases
  • shopt -s expand_aliases - enable expansion (bash default in scripts is off)
  • Alias expansion of first word in command position
  • Trailing space in alias triggers expansion of next word
  • Recursive alias expansion
  • Alias with variable expansion (variables evaluated at use-time, not definition)
  • Alias in subshell and command substitution

Repro

shopt -s expand_aliases
alias hi='echo hello world'
hi
# bashkit outputs: (command not found error)
# expected: hello world

alias echo='echo foo'
echo bar
# expected: foo bar

Test coverage

15 skipped tests in crates/bashkit/tests/spec_cases/bash/alias.test.sh (PR #351).

Oils reference: https://github.com/oilshell/oil/blob/master/spec/alias.test.sh

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions