-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: describe placeholder option for positional args
Signed-off-by: Michael Molisani <[email protected]> Signed-off-by: Michael Molisani <[email protected]>
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
docs/docs/features/argument-parsing/examples/placeholder-argument.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { buildCommand, type CommandContext } from "@stricli/core"; | ||
|
||
export const root = buildCommand({ | ||
func(this: CommandContext, _: {}, src: string, dest: string) { | ||
this.process.stdout.write(`Copying file from ${src} to ${dest}`); | ||
}, | ||
parameters: { | ||
positional: { | ||
kind: "tuple", | ||
parameters: [ | ||
{ | ||
brief: "Source file", | ||
parse: String, | ||
placeholder: "src", | ||
}, | ||
{ | ||
brief: "Destination path", | ||
parse: String, | ||
placeholder: "dest", | ||
}, | ||
], | ||
}, | ||
}, | ||
docs: { | ||
brief: "Example for live playground with positional arguments labeled by placeholders", | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters