Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created March 13, 2018 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Whateverable/e03db5edc08a6c188f4f2e0d11167e4a to your computer and use it in GitHub Desktop.
Save Whateverable/e03db5edc08a6c188f4f2e0d11167e4a to your computer and use it in GitHub Desktop.
greppable6
File Code
UGEXE/zef
…/CLI.pm6 :585:
# TODO: Turn this into a more general getopts
Leont/getopt-long6
…/.gitrepo :7:
remote = https://github.com/Leont/getopt-long6.git
Leont/getopt-long6
…/META6.json :5:
"description" : "A powerful getopt implementation",
Leont/getopt-long6
…/META6.json :12:
"source-url" : "https://github.com/Leont/getopt-long6.git"
araraloren/perl6-app-snippet
…/snippet :19:
my $ret = getopt(|(@interfaces>>.optionset), :autohv, :!strict);
araraloren/perl6-getopt-advance
…/.gitrepo :7:
remote = https://github.com/araraloren/perl6-getopt-advance.git
araraloren/perl6-getopt-advance
…/META6.json :14:
"getopt",
araraloren/perl6-getopt-advance
…/META6.json :32:
"source-url" : "https://github.com/araraloren/perl6-getopt-advance.git",
araraloren/perl6-getopt-advance
…/META6.json :34:
"bugtracker" : "https://github.com.araraloren/perl6-getopt-advance/issues",
araraloren/perl6-getopt-advance
…/META6.json :35:
"source" : "https://github.com/araraloren/perl6-getopt-advance.git"
araraloren/perl6-getopt-advance
…/README.adoc :1:
= perl6-getopt-advance
araraloren/perl6-getopt-advance
…/README.adoc :4:
:keywords: getopt command line option
araraloren/perl6-getopt-advance
…/README.adoc :14:
image:https://travis-ci.org/araraloren/perl6-getopt-advance.svg?branch=master["Build Status", link="https://travis-ci.org/araraloren/perl6-getopt-advance"]
araraloren/perl6-getopt-advance
…/README.zh.adoc :2:
= perl6-getopt-advance
araraloren/perl6-getopt-advance
…/README.zh.adoc :114:
&getopt($optset, :autohv, helper => &ga-helper2);
araraloren/perl6-getopt-advance
…/Advance.adoc :67:
&getopt($optset, :autohv, helper => &ga-helper2);
araraloren/perl6-getopt-advance
…/Advance.adoc :133:
usage generate by `&helper` (helper generator pass to `&getopt`). The third parameter is
araraloren/perl6-getopt-advance
…/Advance.adoc :227:
The parser will call it's check method before return to `&getopt`.
araraloren/perl6-getopt-advance
…/Advance.adoc :239:
== getopt
araraloren/perl6-getopt-advance
…/Advance.adoc :241:
Sub `&getopt` accept one or multi `OptionSet`, pass it and command line argument to the `&parser`.
araraloren/perl6-getopt-advance
…/Advance.adoc :242:
`&getopt` can accept traditional getopt(in C) string, and convert it to `OptionSet`.
araraloren/perl6-getopt-advance
…/Advance.adoc :249:
== `&getopt`
araraloren/perl6-getopt-advance
…/Advance.adoc :251:
Sub `&getopt` accept one or multi `OptionSet`, pass it and command line argument
araraloren/perl6-getopt-advance
…/Advance.adoc :271:
Sub `&getopt` will display the help message in the following cases:
araraloren/perl6-getopt-advance
…/Advance.adoc :276:
* The OptionSet has option named `help`, and `:autohv` passed to `&getopt`.
araraloren/perl6-getopt-advance
…/Advance.adoc :284:
`&getopt` will print helper(when help generator `&helper` defined) of current
araraloren/perl6-getopt-advance
…/Advance.adoc :290:
when `OptionSet` match failed. When `&getopt` caught this exception, it will
araraloren/perl6-getopt-advance
…/Advance.adoc :299:
and print help message of current `OptionSet`. `&getopt` will print helper (when
araraloren/perl6-getopt-advance
…/Advance.adoc :305:
and print help message of all `OptionSet`. `&getopt` will print helper(when
araraloren/perl6-getopt-advance
…/Advance.adoc :310:
* getopt(@args = @*ARGS, Str $optstring, *%args)
araraloren/perl6-getopt-advance
…/Advance.adoc :311:
* getopt(@args = @*ARGS, *@optsets, *%args)
araraloren/perl6-getopt-advance
…/Advance.adoc :317:
This is the command line argument passed to `&getopt`, the default value is `@*ARGS`.
araraloren/perl6-getopt-advance
…/Advance.adoc :318:
And it means you can provide yours "command line argument" to `&getopt`.
araraloren/perl6-getopt-advance
…/Advance.adoc :320:
NOTE: The sub `&getopt` will not modify `@*ARGS`.
araraloren/perl6-getopt-advance
…/Advance.adoc :322:
==== The named argument of &getopt
araraloren/perl6-getopt-advance
…/Advance.adoc :346:
When `$autohv` is True, `&getopt` will automate print `$version` information and help message.
araraloren/perl6-getopt-advance
…/Advance.adoc :380:
NOTE: You should use `&getopt(@args = @*ARGS, Str $optstring, *%args)` instead of this method.
araraloren/perl6-getopt-advance
…/Advance.adoc :518:
The `main` 's callback will be called by `&parser` before return to `&getopt`,
araraloren/perl6-getopt-advance
…/Advance.pm6 :13:
proto sub getopt(|) { * }
araraloren/perl6-getopt-advance
…/Advance.pm6 :18:
multi sub getopt (
araraloren/perl6-getopt-advance
…/Advance.pm6 :28:
multi sub getopt(
araraloren/perl6-getopt-advance
…/Advance.pm6 :38:
multi sub getopt(
araraloren/perl6-getopt-advance
…/Advance.pm6 :49:
multi sub getopt (
araraloren/perl6-getopt-advance
…/create-symbol-directory.p6 :113:
&getopt($os, :autohv, version => "Version 0.0.1."); # autohv will handle <help> or <version>
araraloren/perl6-getopt-advance
…/find-file.p6 :60:
&getopt($optset, :autohv, helper => &ga-helper2);
araraloren/perl6-getopt-advance
…/find-source.p6 :113:
&getopt($os);
araraloren/perl6-getopt-advance
…/02-option.t :26:
getopt(
araraloren/perl6-getopt-advance
…/05-main.t :12:
getopt(
araraloren/perl6-getopt-advance
…/05-main.t :20:
getopt(
araraloren/perl6-getopt-advance
…/06-cmd.t :13:
&main(|getopt(<plus 1 2 3 4 5 6 7 8 9 10>, $optset,));
araraloren/perl6-getopt-advance
…/06-cmd.t :17:
&main(|getopt(<multi 1 2 3 4 5 6 7 8 9 10>, $optset,));
araraloren/perl6-getopt-advance
…/06-cmd.t :26:
getopt(<join | english chinese japanese>, $optset);
araraloren/perl6-getopt-advance
…/06-cmd.t :58:
is &getopt(<< $cmd >>.List, $osa, $osb, $osc).optionset, {a => $osa, b => $osb, c => $osc}{$cmd}, "match cmd ok";
araraloren/perl6-getopt-advance
…/07-pos.t :22:
getopt(<plus 1 2 3 >, $optset);
araraloren/perl6-getopt-advance
…/07-pos.t :26:
getopt(<multi 1 2 3 >, $optset);
araraloren/perl6-getopt-advance
…/07-pos.t :30:
getopt([], $optset);
araraloren/perl6-getopt-advance
…/07-pos.t :34:
getopt(<add 1 2 3 >, $optset);
araraloren/perl6-getopt-advance
…/07-pos.t :46:
getopt(<check some dir1/ >, $optset);
araraloren/perl6-getopt-advance
…/07-pos.t :50:
getopt(<find other dir2/ >, $optset);
araraloren/perl6-getopt-advance
…/07-pos.t :54:
getopt([], $optset);
araraloren/perl6-getopt-advance
…/07-pos.t :66:
getopt(<check some dir1/ >, $optset);
araraloren/perl6-getopt-advance
…/07-pos.t :70:
getopt(<find other dir2/ >, $optset);
araraloren/perl6-getopt-advance
…/07-pos.t :74:
getopt([], $optset);
araraloren/perl6-getopt-advance
…/07-pos.t :86:
getopt(<check dir1/ 1>, $optset);
araraloren/perl6-getopt-advance
…/07-pos.t :90:
getopt(<find dir2/ 2>, $optset);
araraloren/perl6-getopt-advance
…/07-pos.t :94:
getopt([], $optset);
araraloren/perl6-getopt-advance
…/08-helper.t :29:
getopt(["addx", ], $optset);
araraloren/perl6-getopt-advance
…/08-helper.t :33:
getopt(["addx", ], $optset, helper => &ga-helper2);
araraloren/perl6-getopt-advance
…/09-clone.t :21:
getopt([], $optset);
araraloren/perl6-getopt-advance
…/10-x-style.t :15:
getopt(
araraloren/perl6-getopt-advance
…/11-bsd-style.t :13:
getopt(
araraloren/perl6-getopt-advance
…/12-optstring.t :8:
my $ret = getopt(["-h", '-v', '-c', 5, "?"], "hvc:");
araraloren/perl6-getopt-advance
…/13-group.t :16:
getopt( ["-E", "-S"], $optset,);
araraloren/perl6-getopt-advance
…/13-group.t :33:
getopt( ["-a", ], $optset,);
araraloren/perl6-getopt-advance
…/13-group.t :48:
getopt( ["-a", "-b", "-c"], $optset,);
araraloren/perl6-getopt-advance
…/13-group.t :65:
getopt( ["-d", ], $optset,);
arnsholt/Net-ZMQ
…/README.md :32:
unless $Rize.getopt(ZMQ_RCVMORE) == 1 {
arnsholt/Net-ZMQ
…/Socket.pm6 :207:
method getopt($opt) {
arnsholt/Net-ZMQ
…/00-basic.t :35:
is $bob.getopt(ZMQ_RCVMORE), 1, 'getting RCVMORE flag';
azawawi/perl6-gtk-scintilla
…/WidgetGen.py :7:
import getopt
azawawi/perl6-gtk-scintilla
…/WidgetGen.py :218:
opts, args = getopt.getopt(argv, "hcgu", ["help", "clean", "gtk-check", "underscore-names"])
azawawi/perl6-gtk-scintilla
…/sepbuild.py :2:
import getopt
azawawi/perl6-gtk-scintilla
…/sepbuild.py :284:
opts, args = getopt.getopt(sys.argv[1:], "hcdub",
bduggan/p6-jupyter-kernel
…/Service.pm6 :57:
last if not $!socket.getopt: ZMQ_RCVMORE;
jonathanstowe/META6
…/projects.json :10211:
"source-url" : "https://github.com/Leont/getopt-long6.git",
jonathanstowe/META6
…/projects.json :10212:
"description" : "A powerful getopt implementation",
perl6/doc
…/words.pws :398:
getopt
perl6/doc
…/words.pws :399:
getoptions
ppentchev/perl6-Getopt-Std
…/CHANGES.md :21:
- Remove the :all flag and split it out into the getopts-all()
ppentchev/perl6-Getopt-Std
…/README.md :16:
my Str:D %opts = getopts('ho:V', @*ARGS);
ppentchev/perl6-Getopt-Std
…/README.md :31:
my %opts = getopts-all('o:v', @*ARGS);
ppentchev/perl6-Getopt-Std
…/README.md :39:
# Permute usage (with both getopts() and getopts-all()):
ppentchev/perl6-Getopt-Std
…/README.md :45:
%opts = getopts('ho:V', @*ARGS, :permute);
ppentchev/perl6-Getopt-Std
…/README.md :50:
This module exports the `getopts()` and `getopts-all()`> functions for parsing command-line arguments similarly to the POSIX getopt(3) standard C library routine.
ppentchev/perl6-Getopt-Std
…/README.md :54:
If an unrecognized option character is supplied in the arguments array, `getopts()` will throw an exception. Otherwise it will return a has…
ppentchev/perl6-Getopt-Std
…/README.md :59:
* sub getopts
ppentchev/perl6-Getopt-Std
…/README.md :61:
sub getopts(Str:D $optstr, @args, Bool :$nonopts,
ppentchev/perl6-Getopt-Std
…/README.md :66:
Note that if an option is specified more than once on the command line, `getopts()` will only record the last argument in the returned hash; see also the `getopts-all()` function below.
ppentchev/perl6-Getopt-Std
…/README.md :70:
The `:unknown` flag controls the handling of unknown options - ones not specified in the `$optstr`, but present in the `@args`. If it is false (t…
ppentchev/perl6-Getopt-Std
…/README.md :72:
The `:nonopts` flag makes `getopts()` treat each non-option argument as an argument to an option with a character code 1. This is simil…
ppentchev/perl6-Getopt-Std
…/README.md :78:
* sub getopts-all
ppentchev/perl6-Getopt-Std
…/README.md :80:
sub getopts-all(Str:D $optstr, @args, Bool :$nonopts,
ppentchev/perl6-Getopt-Std
…/README.md :83:
Same as the `getopts()` function, but all the returned values are arrays containing all the specified arguments if any options have been specified more than once.
ppentchev/perl6-Getopt-Std
…/README.md :85:
For example, the command line <var>-vI foo -I bar -v</var>, matched against an option string of <var>I:v</var>, would produce `{ :I<bar> :v<vv> }` with `getopts()` and `{ :I(['foo', 'bar']) :v(['v', 'v']) }` with `getopts-all()`.
ppentchev/perl6-Getopt-Std
…/Std.pm6 :54:
sub getopts-parse-optstring(Str:D $optstr) returns Hash[Bool:D]
ppentchev/perl6-Getopt-Std
…/Std.pm6 :61:
sub getopts-collapse-array(Bool:D %defs, Hash[Array[Str:D]] $opts) returns Hash[Str:D]
ppentchev/perl6-Getopt-Std
…/Std.pm6 :71:
sub getopts-all(Str:D $optstr, @args, Bool :$nonopts,
ppentchev/perl6-Getopt-Std
…/Std.pm6 :75:
my Bool:D %defs = getopts-parse-optstring($optstr);
ppentchev/perl6-Getopt-Std
…/Std.pm6 :119:
xdie "getopts() internal error: arguments left with nonopts: @args.perl()" if @args;
ppentchev/perl6-Getopt-Std
…/Std.pm6 :127:
sub getopts(Str:D $optstr, @args, Bool :$nonopts,
ppentchev/perl6-Getopt-Std
…/Std.pm6 :130:
my Bool:D %defs = getopts-parse-optstring($optstr);
ppentchev/perl6-Getopt-Std
…/Std.pm6 :131:
getopts-collapse-array %defs, getopts-all $optstr, @args, :$nonopts, :$permute, :$unknown
ppentchev/perl6-Getopt-Std
…/Std.pm6 :150:
my Str:D %opts = getopts('ho:V', @*ARGS);
ppentchev/perl6-Getopt-Std
…/Std.pm6 :165:
my %opts = getopts-all('o:v', @*ARGS);
ppentchev/perl6-Getopt-Std
…/Std.pm6 :173:
# Permute usage (with both getopts() and getopts-all()):
ppentchev/perl6-Getopt-Std
…/Std.pm6 :179:
%opts = getopts('ho:V', @*ARGS, :permute);
ppentchev/perl6-Getopt-Std
…/Std.pm6 :184:
This module exports the C<getopts()> and C<getopts-all()>> functions for
ppentchev/perl6-Getopt-Std
…/Std.pm6 :185:
parsing command-line arguments similarly to the POSIX getopt(3) standard
ppentchev/perl6-Getopt-Std
…/Std.pm6 :198:
C<getopts()> will throw an exception. Otherwise it will return a hash with
ppentchev/perl6-Getopt-Std
…/Std.pm6 :207:
sub getopts
ppentchev/perl6-Getopt-Std
…/Std.pm6 :209:
sub getopts(Str:D $optstr, @args, Bool :$nonopts,
ppentchev/perl6-Getopt-Std
…/Std.pm6 :217:
C<getopts()> will only record the last argument in the returned hash;
ppentchev/perl6-Getopt-Std
…/Std.pm6 :218:
see also the C<getopts-all()> function below.
ppentchev/perl6-Getopt-Std
…/Std.pm6 :227:
false (the default), C<getopts()> will throw an exception;
ppentchev/perl6-Getopt-Std
…/Std.pm6 :229:
the returned hash as an argument to a C<:> option and C<getopts()> will
ppentchev/perl6-Getopt-Std
…/Std.pm6 :230:
still succeed. This is similar to the behavior of some C<getopt(3)>
ppentchev/perl6-Getopt-Std
…/Std.pm6 :233:
The C<:nonopts> flag makes C<getopts()> treat each non-option argument as
ppentchev/perl6-Getopt-Std
…/Std.pm6 :235:
the behavior of some C<getopt(3)> implementations if C<$optstr> starts
ppentchev/perl6-Getopt-Std
…/Std.pm6 :247:
sub getopts-all
ppentchev/perl6-Getopt-Std
…/Std.pm6 :249:
sub getopts-all(Str:D $optstr, @args, Bool :$nonopts,
ppentchev/perl6-Getopt-Std
…/Std.pm6 :252:
Same as the C<getopts()> function, but all the returned values are
ppentchev/perl6-Getopt-Std
…/Std.pm6 :258:
with C<getopts()> and C<{ :I(['foo', 'bar']) :v(['v', 'v']) }> with
ppentchev/perl6-Getopt-Std
…/Std.pm6 :259:
C<getopts-all()>.
ppentchev/perl6-Getopt-Std
…/01-getopts.t :31:
sub test-getopts(TestCase:D $t)
ppentchev/perl6-Getopt-Std
…/01-getopts.t :53:
&getopts-all, %res-opts;
ppentchev/perl6-Getopt-Std
…/01-getopts.t :65:
&getopts, %exp-opts;
ppentchev/perl6-Getopt-Std
…/01-getopts.t :246:
test-getopts($_) for @tests;
ppentchev/perl6-Getopt-Std
…/03-nonopts.t :16:
lives-ok { %opts = getopts('hI:v', @args) }, 'nonopts base: succeeds';
ppentchev/perl6-Getopt-Std
…/03-nonopts.t :21:
lives-ok { %opts = getopts('hI:v', @args, :nonopts) }, 'nonopts: succeeds';
ppentchev/perl6-Getopt-Std
…/03-nonopts.t :26:
lives-ok { %opts = getopts-all('hI:v', @args, :nonopts) }, 'nonopts all: succeeds';
spebern/Parser-FreeXL-Native
…/ltmain.sh :4361:
/* very simple arg parsing; don't want to rely on getopt
spitsh/spitsh
…/reserved.txt :241:
getopt
spitsh/spitsh
…/reserved.txt :242:
getopts
tadzik/App-redpanda
…/redpanda :42:
sub MAIN(*@targets, *%opts where getopt(<n|notests d|nodeps f|force
tadzik/Getopt-Type
…/README.md :7:
sub MAIN(*%opts where getopt(<f|force v|verbose>)) {
tadzik/Getopt-Type
…/Type.pm :46:
sub getopt(@args) is export {
tadzik/Getopt-Type
…/01-basic.t :6:
sub foo(*%opts where getopt(<force push>)) {
tadzik/Getopt-Type
…/01-basic.t :20:
sub foo(*%opts where getopt(<f|force v|verbose n|never>)) {
tokuhirom/p6-Getopt-Tiny
…/Tiny.pm6 :380:
my $getopt = Getopt::Tiny.new(
tokuhirom/p6-Getopt-Tiny
…/Tiny.pm6 :387:
$getopt.str($short, $long, -> $v { $opts{$long // $short} = $v });
tokuhirom/p6-Getopt-Tiny
…/Tiny.pm6 :390:
$getopt.str($short, $long, -> $v {
tokuhirom/p6-Getopt-Tiny
…/Tiny.pm6 :396:
$getopt.int($short, $long, -> $v { $opts{$long // $short} = $v });
tokuhirom/p6-Getopt-Tiny
…/Tiny.pm6 :399:
$getopt.bool($short, $long, -> $v { $opts{$long // $short} = $v });
tokuhirom/p6-Getopt-Tiny
…/Tiny.pm6 :405:
@*ARGS = $getopt.parse($args);
ugexe/zef
…/CLI.pm6 :698:
# TODO: Turn this into a more general getopts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment