aboutsummaryrefslogtreecommitdiff
path: root/lib/App/Rakumod.rakumod
blob: 722e05aa1be46726f49b9187cdf2c1265876b626 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#! /usr/bin/env false

use v6.d;

use Config;
use IO::Path::XDG;
use Log;

unit module App::Rakumod;

our $config;

#| Initialize the CLI application.
sub rakumod-cli-init (
) is export {
	if (%*ENV<RAKU_LOG_CLASS>:exists) {
		$Log::instance = (require ::(%*ENV<RAKU_LOG_CLASS>)).new;
		$Log::instance.add-output($*OUT, %*ENV<RAKU_LOG_LEVEL> // Log::Level::Info);
	}

	.debug('Setting SUB-MAIN-OPTS') with $Log::instance;

	my %*SUB-MAIN-OPTS =
		:named-anywhere,
	;

	.info('Initializing $config') with $Log::instance;

	$config //= Config.new({
		main => {
			quiet => False,
			template-warnings => True,
		},
		add => {
			prepend-license-lines => '',
		},
		depend => {
			zef-install => False,
		},
		new => {
			path => $*HOME,
		},
	}, :name<rakumod>);
}

=begin pod

=NAME    App::Rakumod
=AUTHOR  Patrick Spek <p.spek@tyil.work>
=VERSION 0.0.0

=head1 Synopsis

=item1 rakumod add <provide> [--kind=<Str>]
=item1 rakumod depend <module>
=item1 rakumod new

=head1 Description

C<App::Rakumod> is a utility for Raku module developers to make their life
easier. It is the successor to
L<C<App::Assixt>|https://home.tyil.nl/git/raku/App::Assixt/about/>.

The bin utility is an acronym for I<B<R>aku B<D>ist B<M>aker>.

=head1 Examples

=head2 Creating a new module

=begin input
rakumod new My::New::Module
=end input

=head2 Adding a new unit to your module

=begin input
rakumod add My::New::Grammar --kind=grammar
=end input

The C<--kind> option will require some configuration. You should consult
C<App::Rakumod::Config>, I<Provide kinds> for more information.

=head1 See also

=item1 C<App::Rakumod::Config>

=end pod

# vim: ft=perl6 noet