build_keep_args function

Build a list of arguments to keep