Giter Site home page Giter Site logo

Comments (4)

Timac avatar Timac commented on June 20, 2024

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?

from vpnstatus.

Tormen avatar Tormen commented on June 20, 2024

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

from vpnstatus.

Tormen avatar Tormen commented on June 20, 2024

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

from vpnstatus.

Timac avatar Timac commented on June 20, 2024

@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 #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"
    }
  ]
}

from vpnstatus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.