nom: basic refactoring

wip/nixpkgs-raku
Katharina Fey 3 years ago
parent c54e75331d
commit 6487214968
Signed by: kookie
GPG Key ID: 90734A9E619C8A6C
  1. 1
      infra/nom/LICENSE
  2. 5
      infra/nom/bin/nom-split
  3. 13
      infra/nom/clap/README.md
  4. 39
      infra/nom/clap/lib/Clap/Clap.rakumod
  5. 11
      infra/nom/clap/test.raku
  6. 7
      infra/nom/main.raku

@ -0,0 +1 @@
/home/Projects/kookienomicon/licenses/GPL-3.0

@ -0,0 +1,5 @@
#!/usr/bin/env raku
sub MAIN() {
}

@ -1,13 +0,0 @@
# Command Line Argument Parser
A flexible CLI parser for raku. Inspired by
[clap.rs](https://clap.rs)!
## Usage
Install clap with zef!
```console
$ zip install clap
```

@ -1,39 +0,0 @@
unit module Clap;
say "Loading clap...";
class Subcommand is export {
has Str $.name;
has Str $.about is rw;
method with_name(Str $name) returns Subcommand {
return self.bless(:$name);
}
method about(Str $about) returns Subcommand {
$!about = $about;
return self;
}
}
class App is export {
has Str $.about is rw;
has Str $.author is rw;
has @.subs is rw = Array.new();
method about(Str $about) returns App {
$!about = $about;
return self;
}
method author(Str $author) returns App {
$!author = $author;
return self;
}
method subcommand(Subcommand $cmd) returns App {
@.subs.push($cmd);
return self;
}
}

@ -1,11 +0,0 @@
use lib 'lib/Clap';
use Clap;
my $app = App.new()
.about("This is some about text")
.author("Katharina Fey <kookie@spacekookie.de>")
.subcommand(Subcommand
.with_name("build")
.about("Do some thing"));
say $app;

@ -1,7 +0,0 @@
## kookieNOMicon manager
#
#
sub MAIN() {
}
Loading…
Cancel
Save