Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Documentation] add cli examples #124

Open
xenoterracide opened this issue Jul 27, 2022 · 0 comments
Open

[Documentation] add cli examples #124

xenoterracide opened this issue Jul 27, 2022 · 0 comments

Comments

@xenoterracide
Copy link

xenoterracide commented Jul 27, 2022

for example on https://mael.dev/clipanion/docs/paths

what is the command I would run? the reason I want this is I've been trying to figure out how to do --port, but from these docs I don't see what's obviously an example of that, there's this https://mael.dev/clipanion/docs/options but it doesn't show any examples of how to code those. I imagine it's on the previous page but it's hard to correlate the 2. Also, I don't see an example of how to create a command with no paths, although simply not defining paths seems to work. If I have an option, how do I pass it to a command?

class InstallCommand extends Command {
    static paths = [[`install`], [`i`]];
    async execute() {
        // ...
    }
}

also, https://mael.dev/clipanion/docs/contexts appears to be out of date, as BaseContext no longer contains some of that
https://mael.dev/clipanion/docs/validation apply cascade signature is marked as deprecated

from the code I assumed this would create a port option, but it instead creates an argument

export class App extends Command {
  readonly port = Option.String({ validator: isPort, required: true })

  static readonly paths = [Command.Default]
❯ yarn workspace @cof/e1-fake-chamber-of-secrets run serve
Unknown Syntax Error: Unsupported option name ("--port").
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant