Code Monkey home page Code Monkey logo

Comments (4)

rohityadavcloud avatar rohityadavcloud commented on July 27, 2024

@braderhart does it make any difference if you use cmk from the powershell terminal?

from cloudstack-cloudmonkey.

onitake avatar onitake commented on July 27, 2024

It's a bit unfortunate that cloudmonkey doesn't use one of the standard Go flag packages (such as https://github.com/spf13/cobra ). This would make it much easier to add bash completion support.

On the other hand, it shouldn't be too difficult to use something like https://github.com/posener/complete directly.

from cloudstack-cloudmonkey.

rohityadavcloud avatar rohityadavcloud commented on July 27, 2024

@onitake cobra is not a standard Go flag package, besides it's a heavily bloated dependency. cmk already uses the standard flag package: https://github.com/apache/cloudstack-cloudmonkey/blob/master/cmk.go#L21

cmk provides an autocompletion for not just parameters but also parameter values when used in the shell mode. I'm not sure other stated dependencies provide value completion (by querying via a server-side request) as well. Pull requests are welcome!

from cloudstack-cloudmonkey.

onitake avatar onitake commented on July 27, 2024

@rhtyd I totally agree with you on that one. However, by using cobra, bash autocompletion would be easier to add.
The standard flag package is very primitive and cannot autogenerate bash autocompletion strings like many Go tools do.

The semi-dynamic nature of cmk will certainly make it a bit more difficult to implement this - but there are many tools that do send server requests when autocompleting. scp and kubectl come to mind.

posener/complete is compatible with the standard flags package, so integrating it into cmk will be easy. What will be a bit more complicated is adding the dynamic commands. The documentation is here: https://godoc.org/github.com/posener/complete

from cloudstack-cloudmonkey.

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.