Giter Site home page Giter Site logo

Comments (6)

LucasRoesler avatar LucasRoesler commented on August 22, 2024

I think the cleanest solution is to support the file:// scheme or to treat scheme-less urls as local paths.

from faas-cli.

alexellis avatar alexellis commented on August 22, 2024

file:// is the easiest solution, but not the cleanest.

It's confusing vs. faas-cli deploy -f / --yaml local-file, and many other tools people are used to like "kubectl" work with "kubectl apply -f https://andkuebctl apply -f ./some-local-file.yaml`

A mix of the two might work. --url with a local path, with or without a file:// scheme could be accepted and resolve to a local file if it looks like one.

from faas-cli.

LucasRoesler avatar LucasRoesler commented on August 22, 2024

Maybe move from --url to a more generic --store which supports local files or a url, like kubectl and others.

Then add a flag alias from --store to --url for backwards compat and then convert all docs to only reference --store. It is also possible to make --url hidden so that it is supported but doesn't show in the cli --help

from faas-cli.

alexellis avatar alexellis commented on August 22, 2024

I think that could work 👍

Are you interested in contributing it?

from faas-cli.

rgee0 avatar rgee0 commented on August 22, 2024

Lucas' approach but treading carefully with the word in the new flag.

faas-cli store deploy figlet --store ./functions.json

jars slightly because the same word is a command and a flag. Ultimately, however the file is retrieved its a file:

faas-cli store deploy figlet --file ./functions.json

and

faas-cli store deploy figlet --file https://raw.githubusercontent.com/openfaas/store/master/functions.json

Side note: From a UX / PO perspective I'd suggest that faas-cli template store mirrors whatever behaviour is settled on here

from faas-cli.

LucasRoesler avatar LucasRoesler commented on August 22, 2024

Sure I can do this.

Good point by @rgee0, I originally thought file or url was a bit like showing the details of how it works, but it probably isn't an issue here. It is not likely to be the most popular flag in the CLI :) I will stick with --file

from faas-cli.

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.