#!/usr/bin/env perl

use warnings;
use strict;

use Data::Dumper;
use RPi::WiringPi;

if (@ARGV) {
    _help() if $ARGV[0] eq '-h' || $ARGV[0] eq '--help';
}

my $pi = RPi::WiringPi->new(fatal_exit => 0);

$pi->clean_shared();
$pi->cleanup;

my $meta = $pi->metadata;

print "\nCurrent state of shared data storage:\n\n";

print Dumper $meta;

sub _help {
    print <DATA>;
    exit;
}

__DATA__

pi-erase-metadata

Completely erases and resets the shared memory storage location.

WARNING: If there are processes running currently using RPi::WiringPi, you will
confuse and/or break things...

