anz-bank / sysl

Sysl (pronounced "sizzle") is a system specification language
https://sysl.io
Apache License 2.0
122 stars 42 forks source link

--title flag has lower precedence than [title] attribute #915

Open orlade-anz opened 4 years ago

orlade-anz commented 4 years ago

Please do not post any internal, closed source snippets on this public issue tracker!

Description

When generating a diagram with sysl ints, the [title="%(epname)"] attr has higher precedence than the --title flag, which I believe is wrong since the flag is closer to the call, and flags exist primarily to override default behaviour.

Steps to Reproduce

  1. Create a .sysl spec:
    
    HelloService:
    GetGreeting(userId):
        ...

HelloApp: Greet: HelloService <- GetGreeting

HelloProject [title="%(epname)", appfmt="%(appname)"]: Greeting: HelloApp HelloApp <- Greet

2. Generate a diagram with `sysl ints --project=HelloProject hello.sysl --title="foo"`

**Expected behavior:**

Diagram with title "foo"

**Actual behavior:**

Dialog with title "Greeting"

### Your Environments
<!---
Run `sysl info` and `sysl env` to show the sysl binary info and related envvars, and paste the result between the ``` marks below.
If you are not running the latest version of sysl, please try upgrading because your issue may have already been fixed.
-->
```sh
$ sysl info
Build:
  Version      : DIRTY-c9101bf3412d4abcb45c7446c5aa44ce4aba2fca (from v0.117.0)
  Git Commit   : c9101bf3412d4abcb45c7446c5aa44ce4aba2fca
  Date         : 2020-06-24T04:31:17Z
  Go Version   : go1.14.4 darwin/amd64
  OS           : darwin/amd64

$ sysl env
SYSL_MODULES=""
SYSL_PLANTUML="http://localhost:8080"