### Exercise: Build a Command-Line Calculator

**Objective**: Create a Python script that performs basic arithmetic operations (add, subtract, multiply, divide) using command-line arguments.

#### Requirements:
1. The script should take three arguments:
   - The first number (float or integer)
   - An operator (`+`, `-`, `*`, `/`)
   - The second number (float or integer)
2. The script should validate:
   - The number of arguments provided.
   - The operator is valid.
   - Division by zero is handled gracefully.
3. Print the result to the console.

---

### Sample Script: `calculator.py`
Here’s how the script should work:

#### Example 1:
```bash
$ python calculator.py 10 + 5
Result: 15
```

#### Example 2:
```bash
$ python calculator.py 10 / 0
Error: Division by zero is not allowed.
```

---

### Steps to Solve:
1. Parse command-line arguments using the `sys.argv` list.
2. Validate the inputs and handle errors appropriately.
3. Perform the calculation and display the result.

---

Here’s a solution template you can expand:

```python
import sys

def main():
    # Check if the correct number of arguments is provided
    if len(sys.argv) != 4:
        print("Usage: python calculator.py   ")
        return
    
    # Parse command-line arguments
    try:
        num1 = float(sys.argv[1])
        operator = sys.argv[2]
        num2 = float(sys.argv[3])
    except ValueError:
        print("Error: Both numbers must be valid floats or integers.")
        return
    
    # Perform the calculation based on the operator
    if operator == '+':
        result = num1 + num2
    elif operator == '-':
        result = num1 - num2
    elif operator == '*':
        result = num1 * num2
    elif operator == '/':
        if num2 == 0:
            print("Error: Division by zero is not allowed.")
            return
        result = num1 / num2
    else:
        print("Error: Operator must be one of '+', '-', '*', or '/'.")
        return
    
    # Print the result
    print(f"Result: {result}")

if __name__ == "__main__":
    main()
```

---

### Bonus Challenge
Expand the calculator to support:
- Exponentiation (`^`)
- Modulus (`%`)
- Custom error messages for invalid input.

#### Example:
```bash
$ python calculator.py 10 ^ 3
Result: 1000
```