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

docs(cli): remove parseArgs() console logs from examples #6268

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions cli/parse_args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* Command line arguments parser based on
* {@link https://github.com/minimistjs/minimist | minimist}.
*
* @example
* @example Usage
* ```ts
* import { parseArgs } from "@std/cli/parse-args";
*
* console.dir(parseArgs(Deno.args));
* const args = parseArgs(Deno.args);
* ```
*
* @module
Expand Down Expand Up @@ -278,14 +278,18 @@ export interface ParseOptions<
*
* @default {false}
*
* @example
* @example Double dash option is false
* ```ts
* // $ deno run example.ts -- a arg1
* import { parseArgs } from "@std/cli/parse-args";
* const args = parseArgs(Deno.args, { "--": false }); // args equals { _: [ "a", "arg1" ] }
* ```
*
* @example Double dash option is true
* ```ts
* // $ deno run example.ts -- a arg1
* import { parseArgs } from "@std/cli/parse-args";
* console.dir(parseArgs(Deno.args, { "--": false }));
* // output: { _: [ "a", "arg1" ] }
* console.dir(parseArgs(Deno.args, { "--": true }));
* // output: { _: [], --: [ "a", "arg1" ] }
* const args = parseArgs(Deno.args, { "--": true }); // args equals { _: [], --: [ "a", "arg1" ] }
* ```
*/
"--"?: TDoubleDash;
Expand Down
Loading