[While this does not directly address the question as it is asked, I have found the following alternate approach useful and more practical in my diagrams. I'll leave it here for anyone else who comes here from a search engine.]
Define the diagram name as a "variable" and assign it from the CLI. So in the example from the question:
@startuml diagram_name
[...]
footer %filename() - diagram_name
@enduml
Let the "diagram_name" be an actual variable name rather than a "placeholder" as in the question. Then while generating the diagram, specify:
java -jar plantuml.jar -Ddiagram_name=My_Amazing_Diagram diagram.puml