# Pastebin Z3VyMUSj #!/usr/bin/env perl6 use lib "."; use lib "lib"; use Settings; my %*SUB-MAIN-OPTS = :named-anywhere; proto MAIN( Str $product, #= product name (BUMP/GALLERY/...) IO(Str) :$bn where .d = ".", #= path to bomnegocio repo IO(Str) :$bconf where .f = "$bn/conf/common/bconf/bconf.txt.product_price", #= path to the product_price bconf Str :$settings-node where /<[\w.-]>+/ = "*.*.product_price_settings", #= settings bconf node | ) { my $*settings = Settings.new: :$bconf, :node("$settings-node.$product"); {*} } #| print the settings multi MAIN($product) { .say for $*settings.lines } #| search a value into the settings multi MAIN($product, "search", *%data) { my @a := $*settings.find: %data; say @a; } subset DataToSet of Str where /[<[\w-]>+ '=' <-[,]>+]+ % ","/; #| change value multi MAIN( $product, "set", DataToSet :$set!, #= format: --set=price=1234.56,another-key=another-value *%data ) { my %new-data = $set.split(',').map: { Pair.new: |.split: "=" }; $*settings.set: %data, %new-data; .say for $*settings.lines }