Skip to content

have aliases issue warning if which doesn't resolve program #63

@tomasohara

Description

@tomasohara

Aliases using which to locate programs should use helper that issues warning when the program is not found. This will avoid warnings like the following:

$ echo hey | check-errors 2>&1 | cat
/home/ec2-user/anaconda3/bin/python3: can't find '__main__' module in '/home/ec2-user/'

This happens because check-errors uses convert_emoticons.py for filtering:

$ show-macros check-errors
...
check-errors () 
{ 
    local args=("$@");
    if [[ ( $# -eq 0 ) || ( ${args[$# - 1]} =~ ^-+ ) ]]; then
        args+=("-");
    fi;
    ( DEBUG_LEVEL=$ALIAS_DEBUG_LEVEL QUIET=1 DURING_ALIAS=1 CONTEXT=5 check-errors-aux "${args[@]}" ) 2>&1 | DEBUG_LEVEL=$ALIAS_DEBUG_LEVEL DURING_ALIAS=1 DEBUG_LEVEL=$ALIAS_DEBUG_LEVEL python3 "$(which convert_emoticons.py)" - | $PAGER
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions