Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you get out of the cfn-dia menu? #32

Closed
john-aws opened this issue Mar 10, 2021 · 4 comments
Closed

How do you get out of the cfn-dia menu? #32

john-aws opened this issue Mar 10, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@john-aws
Copy link

Installed on Mac, I ran cfn-dia draw.io -t template.yml. That presented me with the following text-based configuration menu:

Diagram will be written to template.drawio
Press CTRL+C to exit
? Options (Use arrow keys)
❯ Filter resources by type
  Filter resources by name
  Edge labels: On

Hitting Enter navigates into an option where you can make changes, but there is no clear way to actually tell cfn-dia "OK, now do it". No combination of keypresses seems to get you out of the menu and tell cfn-dia to actually diagram the supplied template. You are stuck in the menu.

I resorted to reading your package.json and see that you are using the inquirer NPM package but their documentation didn't provide any clue either.

How do you get out of the menu (other than to hit ctrl+c and exit)?

@john-aws
Copy link
Author

john-aws commented Mar 10, 2021

Oh wow. I've just realized that if you hit ctrl+c to exit, it will actually write out the template.drawio file.

This seems to be very unintuitive. Would you consider changing this to something more appropriate, or at least document that this is how you get the tool to work (as opposed to killing the app, as I think most people would expect ctrl+c to do)?

@ljacobsson
Copy link
Owner

Hi @john-aws,

Thanks for your feedback - I agree it's unintuitve to use the kill process command to exit the app.

The way it's set up is that the template.drawio file is created upon launch with everything visible by default. Each time you toggle any filters it'll rewrite the file, Nothing actually gets written when you hit ctrl+c.

The idea is that you keep the diagram open in vscode with this extension installed whilst you tweak the filters.

How about the following actions?

  1. I add an 'Exit' option from the menu
  2. Hitting exit will prompt you if you want to keep the diagram or not

@ljacobsson ljacobsson added the enhancement New feature or request label Mar 11, 2021
@john-aws
Copy link
Author

john-aws commented Mar 11, 2021

Thanks for the quick response. The explanation makes sense and I think your proposed changes would be very helpful, thank you.

In my short experience with the Draw.io VS Code plugin, it doesn't reliably refresh the diagram when you make changes using cfn-dia. It typically works first time I make cfn-dia changes but not thereafter. The underlying template.drawio file is being updated each time and the drawio template size is changing but, on Mac OS X, the VS Code plugin is not detecting that change (or not refreshing the diagram, after the first refresh). I'll take that up with the plug-in author.

@ljacobsson
Copy link
Owner

This enhancement will be released shortly.

I've experienced what you describe with the diagram not updating, but not very often (am on linux). I've seen it for other file types as well that's been modified by another process, so I wonder if it's a vscode thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants