Generate an appropriate Python command to edit the following list such that all the negative numbers are replaced with 0.
[-1, 5, 9, -8, 2]
def filter_negative(nums):
    return [max(0, n) for n in nums]