Options for specifying name of output file

For many tools, I want to be able to specify the name of an output file that the tool will create. My approach for doing this has been to create a string input for the name of the output file and then specify that name in my command. Below is a super-simple example. Is there a better way to do this? It works well, but it seems odd to specify an output as an input, so to speak. Thanks!

cwlVersion: v1.1
class: CommandLineTool
requirements:
  ShellCommandRequirement: {}
  DockerRequirement:
    dockerPull: python:3.8.2-slim-buster
  InitialWorkDirRequirement:
    listing:
    - entryname: add.py
      entry: |-
        from sys import argv

        x = int(argv[1])
        y = int(argv[2])
        output_file_name = argv[3]

        with open(output_file_name, "w") as output_file:
            output_file.write(str(x + y))
inputs:
  x:
    type: int
  y:
    type: int
  output_file_name:
    type: string
arguments:
    - shellQuote: false
      valueFrom: |-
        python add.py $(inputs.x) $(inputs.y) $(inputs.output_file_name)
outputs:
  output_file:
    type: File
    outputBinding:
      glob: "$(inputs.output_file_name)"

Here’s my input object file:

x: 3
y: 30
output_file_name: sum.txt

Yes, that’s the standard pattern. If you think about it, you want the input to include everything that influences the output, so if you consider the output filename as part of the output, then it makes sense for the name to be included in the input – a different name in the input gives a differently named output file.