Giter VIP home page Giter VIP logo

Comments (3)

rderik avatar rderik commented on September 17, 2024 2

Yes, another case is when we would like to inspect the parameters so the command handles arguments from the STDIN or from files. To exemplify take the Unix command head

we could send arguments to head through a pipe:
cat Package.swift | head
or we can send filenames as arguments to command.
head Package.swift README.md

Ruby handles these cases using ARGF. for an example: https://rderik.com/blog/shell-friendly-ruby-scripts/. If we could provide something similar I think it would be helpful to build commands that are friendly to be composed not just stand-alone commands.

from console-kit.

calebkleveter avatar calebkleveter commented on September 17, 2024

In Console 4, would it be ok to do this?

final class Run: Command {
    struct Signature: CommandSignature { }
    let signature: Run.Signature = Signature()

    // ....
}

There isn't any signature validation unless you set strict to true, so it would work.

from console-kit.

tanner0101 avatar tanner0101 commented on September 17, 2024

This now exists as AnyCommand.

from console-kit.

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.