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

vpnutil: Update 'usage' to mention 'list' option #26

Closed
Tormen opened this issue Aug 30, 2023 · 4 comments
Closed

vpnutil: Update 'usage' to mention 'list' option #26

Tormen opened this issue Aug 30, 2023 · 4 comments

Comments

@Tormen
Copy link

Tormen commented Aug 30, 2023

Ability to list all VPNs and their status: Minimum: Name of VPN (as needed for start and stop command, as well as status of VPN (I imagine the possibilities would be: connected, disconnected, connecting, ...).

Make this feature accessible via a 3rd command parameter (instead of start/stop): Something like list.

Output format: I don't really mind. The possibilities I see:

  • Maybe output in TABLE format using TAB as separator.
  • Or output in RECORD format.
  • Or as suggested in JSON format.

This would really be useful.
Especially as the MacOS built-in tools don't seem to be able :/

Please let me know what would be needed in terms of financial sponsoring for this item. Thanks a lot in advance!

@Timac
Copy link
Owner

Timac commented Aug 30, 2023

Hey @Tormen ,

The vpnutil command line tool already supports a list parameter. When running the command vpnutil list, you will see an output like:

VPN1 Connected
VPN2 Disconnected
VPN3 Disconnected

where VPN1, VPN2 and VPN3 are the names of the VPNs.

I assume that you would prefer to get a JSON output format like:

{
  "VPN1": {
    "status": "Connected"
  },
  "VPN2": {
    "status": "Disconnected"
  },
  "VPN3": {
    "status": "Disconnected"
  }
}

Would this JSON work for you? Is there anything missing in this output that you would like to see?

@Tormen
Copy link
Author

Tormen commented Aug 30, 2023

Hi @Timac ,

Thank you!

In this case I would suggest the following to avoid similar confusion for others:
Could you please change the output when calling "vpnutil" to show that there is such a list parameter ?

As for me the "Usage" did NOT talk about "list" I (had to assume) that there is no list parameter :D

This is what I see when executing vpnutil without parameters (latest stable precompiled version, downloaded today from this GitHub):

Usage: vpnutil [start|stop] [VPN name]
Examples:
	 To start the VPN called 'MyVPN':
	 vpnutil start MyVPN

	 To stop the VPN called 'MyVPN':
	 vpnutil stop MyVPN

	 To list all available VPNs and their state:
	 vpnutil list

	 To get the status of the VPN called 'MyVPN':
	 vpnutil status MyVPN

Copyright © 2018-2023 Alexandre Colucci
blog.timac.org

@Tormen Tormen changed the title vpnutil: Ability to show status of (all) VPNs vpnutil: Update 'usage' to mention 'list' option Aug 30, 2023
@Tormen
Copy link
Author

Tormen commented Aug 30, 2023

Hi @Timac ,

I had another look at the current output of the list command and:

The output of the list command could be improved
by using a "TAB" character, instead of "SPACE"
to separate the NAME of the VPN and the status,
as the VPN NAME /can/ also contain spaces.

Tormen

Timac added a commit that referenced this issue Aug 31, 2023
Add the missing options to the usage
@Timac
Copy link
Owner

Timac commented Aug 31, 2023

@Tormen Thanks again for the great suggestions. I implemented 2 changes:

  • The usage now mentions the list parameter
  • vpnutil list now outputs a json format. This issue was also tracked by Machine-readable output for vpnutil #12 . If you run vpnutil list, you should now see a json like this:
{
  "VPNs" : [
    {
      "name" : "VPN1",
      "status" : "Connected"
    },
    {
      "name" : "VPN2",
      "status" : "Disconnected"
    },
    {
      "name" : "VPN3",
      "status" : "Disconnected"
    }
  ]
}

@Timac Timac closed this as completed Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants