Closed LinMaris closed 5 years ago
Could you post some of your code? It's hard to diagnose the issue without seeing the code itself
~ > greeter greet Jack Expected 2 arguments, but got 1.
This was just an example. If you compiled the first block of code in the README:
import SwiftCLI
class GreetCommand: Command { let name = "greet" let person = Parameter() func execute() throws { stdout <<< "Hello (person.value)!" } }
let greeter = CLI(name: "greeter") greeter.commands = [GreetCommand()] greeter.go()
and put the file somewhere in your $PATH, you could run it by doing `greeter greet Jack`. My guess is that your code is slightly differenct.
***
> Where did I go wrong? and I need to install `Ice` ?
[Ice](https://github.com/jakeheis/Ice) is a command line tool that runs on top of the Swift Package Manager. You don't need it in order to install SwiftCLI.
***
I hope I answered your questions, and I'm sorry if I misunderstood you.
I think @Samasaur1 addressed your confusion fully, feel free to reopen this with more details if need be
my terminal is
$
, not>
, I useSwiftCLI
by SwiftPM, but I can't find commandgreeter greet
, Where did I go wrong? and I need to installIce
?