Whenever you're using alias tasks, you can't pass a flag to aliased tasks. Here are a few patterns to deal with that.
For a global setting available to all tasks, use options:
grunt.registerTask('upload', 'Upload code to deploy', function(n) {
var target = grunt.option('target');
// use target var to do something useful
});