App-UnixUIDUtils

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.002   2022-07-24  Released-By: PERLANCAR; Urgency: medium

        - Replaca old schema name unix::local_{uid,username,gid,groupname}
          with unix::{uid,username,gid,groupname}::exists.


0.001   2020-06-13  Released-By: PERLANCAR

        - First release, mainly to test Sah-Schemas-Unix.

MANIFEST  view on Meta::CPAN

# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.024.
Changes
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
README
dist.ini
lib/App/UnixUIDUtils.pm
script/gid-to-groupname
script/groupname-to-gid
script/uid-to-username
script/username-to-uid
t/00-compile.t
t/author-critic.t
t/author-pod-coverage.t
t/author-pod-syntax.t
t/release-rinci.t
weaver.ini

META.json  view on Meta::CPAN

            "Test::Rinci" : "0.151"
         },
         "x_spec" : {
            "Rinci" : "v1.1.102"
         }
      },
      "runtime" : {
         "requires" : {
            "Data::Sah::Compiler::perl::TH::int" : "0.911",
            "Data::Sah::Compiler::perl::TH::str" : "0.911",
            "Data::Sah::Filter::perl::Unix::check_gid_exists" : "0",
            "Data::Sah::Filter::perl::Unix::check_uid_exists" : "0",
            "Data::Sah::Filter::perl::Unix::check_unix_group_exists" : "0",
            "Data::Sah::Filter::perl::Unix::check_unix_user_exists" : "0",
            "Data::Sah::Filter::perl::Unix::convert_gid_to_unix_group" : "0",
            "Data::Sah::Filter::perl::Unix::convert_uid_to_unix_user" : "0",
            "Data::Sah::Filter::perl::Unix::convert_unix_group_to_gid" : "0",
            "Data::Sah::Filter::perl::Unix::convert_unix_user_to_uid" : "0",
            "Log::ger" : "0.038",
            "Perinci::CmdLine::Any" : "0.152",
            "Perinci::CmdLine::Lite" : "1.915",
            "Sah::Schema::unix::gid::exists" : "0",
            "Sah::Schema::unix::groupname::exists" : "0",
            "Sah::Schema::unix::uid::exists" : "0",
            "Sah::Schema::unix::username::exists" : "0",
            "perl" : "5.010001",
            "strict" : "0",
            "warnings" : "0"
         }
      },
      "test" : {
         "requires" : {

META.json  view on Meta::CPAN

            "name" : "GenPericmdScript uid-to-username",
            "version" : "0.424"
         },
         {
            "class" : "Dist::Zilla::Plugin::GenPericmdScript",
            "name" : "GenPericmdScript username-to-uid",
            "version" : "0.424"
         },
         {
            "class" : "Dist::Zilla::Plugin::GenPericmdScript",
            "name" : "GenPericmdScript gid-to-groupname",
            "version" : "0.424"
         },
         {
            "class" : "Dist::Zilla::Plugin::GenPericmdScript",
            "name" : "GenPericmdScript groupname-to-gid",
            "version" : "0.424"
         },
         {
            "class" : "Dist::Zilla::Plugin::InsertExecsList",
            "name" : "InsertExecsList",
            "version" : "0.02"
         },
         {
            "class" : "Dist::Zilla::Plugin::PERLANCAR::CheckPendingRelease",
            "name" : "@Author::PERLANCAR/PERLANCAR::CheckPendingRelease",

META.yml  view on Meta::CPAN

  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: App-UnixUIDUtils
provides:
  App::UnixUIDUtils:
    file: lib/App/UnixUIDUtils.pm
    version: '0.002'
requires:
  Data::Sah::Compiler::perl::TH::int: '0.911'
  Data::Sah::Compiler::perl::TH::str: '0.911'
  Data::Sah::Filter::perl::Unix::check_gid_exists: '0'
  Data::Sah::Filter::perl::Unix::check_uid_exists: '0'
  Data::Sah::Filter::perl::Unix::check_unix_group_exists: '0'
  Data::Sah::Filter::perl::Unix::check_unix_user_exists: '0'
  Data::Sah::Filter::perl::Unix::convert_gid_to_unix_group: '0'
  Data::Sah::Filter::perl::Unix::convert_uid_to_unix_user: '0'
  Data::Sah::Filter::perl::Unix::convert_unix_group_to_gid: '0'
  Data::Sah::Filter::perl::Unix::convert_unix_user_to_uid: '0'
  Log::ger: '0.038'
  Perinci::CmdLine::Any: '0.152'
  Perinci::CmdLine::Lite: '1.915'
  Sah::Schema::unix::gid::exists: '0'
  Sah::Schema::unix::groupname::exists: '0'
  Sah::Schema::unix::uid::exists: '0'
  Sah::Schema::unix::username::exists: '0'
  perl: '5.010001'
  strict: '0'
  warnings: '0'
resources:
  bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=App-UnixUIDUtils
  homepage: https://metacpan.org/release/App-UnixUIDUtils
  repository: git://github.com/perlancar/perl-App-UnixUIDUtils.git

META.yml  view on Meta::CPAN

    -
      class: Dist::Zilla::Plugin::GenPericmdScript
      name: 'GenPericmdScript uid-to-username'
      version: '0.424'
    -
      class: Dist::Zilla::Plugin::GenPericmdScript
      name: 'GenPericmdScript username-to-uid'
      version: '0.424'
    -
      class: Dist::Zilla::Plugin::GenPericmdScript
      name: 'GenPericmdScript gid-to-groupname'
      version: '0.424'
    -
      class: Dist::Zilla::Plugin::GenPericmdScript
      name: 'GenPericmdScript groupname-to-gid'
      version: '0.424'
    -
      class: Dist::Zilla::Plugin::InsertExecsList
      name: InsertExecsList
      version: '0.02'
    -
      class: Dist::Zilla::Plugin::PERLANCAR::CheckPendingRelease
      name: '@Author::PERLANCAR/PERLANCAR::CheckPendingRelease'
      version: '0.001'
    -

Makefile.PL  view on Meta::CPAN

use ExtUtils::MakeMaker;

my %WriteMakefileArgs = (
  "ABSTRACT" => "Utilities related to Unix UID/GID",
  "AUTHOR" => "perlancar <perlancar\@cpan.org>",
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "App-UnixUIDUtils",
  "EXE_FILES" => [
    "script/gid-to-groupname",
    "script/groupname-to-gid",
    "script/uid-to-username",
    "script/username-to-uid"
  ],
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.010001",
  "NAME" => "App::UnixUIDUtils",
  "PREREQ_PM" => {
    "Data::Sah::Compiler::perl::TH::int" => "0.911",
    "Data::Sah::Compiler::perl::TH::str" => "0.911",
    "Data::Sah::Filter::perl::Unix::check_gid_exists" => 0,
    "Data::Sah::Filter::perl::Unix::check_uid_exists" => 0,
    "Data::Sah::Filter::perl::Unix::check_unix_group_exists" => 0,
    "Data::Sah::Filter::perl::Unix::check_unix_user_exists" => 0,
    "Data::Sah::Filter::perl::Unix::convert_gid_to_unix_group" => 0,
    "Data::Sah::Filter::perl::Unix::convert_uid_to_unix_user" => 0,
    "Data::Sah::Filter::perl::Unix::convert_unix_group_to_gid" => 0,
    "Data::Sah::Filter::perl::Unix::convert_unix_user_to_uid" => 0,
    "Log::ger" => "0.038",
    "Perinci::CmdLine::Any" => "0.152",
    "Perinci::CmdLine::Lite" => "1.915",
    "Sah::Schema::unix::gid::exists" => 0,
    "Sah::Schema::unix::groupname::exists" => 0,
    "Sah::Schema::unix::uid::exists" => 0,
    "Sah::Schema::unix::username::exists" => 0,
    "strict" => 0,
    "warnings" => 0
  },
  "TEST_REQUIRES" => {
    "File::Spec" => 0,
    "IO::Handle" => 0,
    "IPC::Open3" => 0,

Makefile.PL  view on Meta::CPAN

  "VERSION" => "0.002",
  "test" => {
    "TESTS" => "t/*.t"
  }
);


my %FallbackPrereqs = (
  "Data::Sah::Compiler::perl::TH::int" => "0.911",
  "Data::Sah::Compiler::perl::TH::str" => "0.911",
  "Data::Sah::Filter::perl::Unix::check_gid_exists" => 0,
  "Data::Sah::Filter::perl::Unix::check_uid_exists" => 0,
  "Data::Sah::Filter::perl::Unix::check_unix_group_exists" => 0,
  "Data::Sah::Filter::perl::Unix::check_unix_user_exists" => 0,
  "Data::Sah::Filter::perl::Unix::convert_gid_to_unix_group" => 0,
  "Data::Sah::Filter::perl::Unix::convert_uid_to_unix_user" => 0,
  "Data::Sah::Filter::perl::Unix::convert_unix_group_to_gid" => 0,
  "Data::Sah::Filter::perl::Unix::convert_unix_user_to_uid" => 0,
  "File::Spec" => 0,
  "IO::Handle" => 0,
  "IPC::Open3" => 0,
  "Log::ger" => "0.038",
  "Perinci::CmdLine::Any" => "0.152",
  "Perinci::CmdLine::Lite" => "1.915",
  "Sah::Schema::unix::gid::exists" => 0,
  "Sah::Schema::unix::groupname::exists" => 0,
  "Sah::Schema::unix::uid::exists" => 0,
  "Sah::Schema::unix::username::exists" => 0,
  "Test::More" => 0,
  "strict" => 0,
  "warnings" => 0
);


unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {

README  view on Meta::CPAN

NAME
    App::UnixUIDUtils - Utilities related to Unix UID/GID

VERSION
    This document describes version 0.002 of App::UnixUIDUtils (from Perl
    distribution App-UnixUIDUtils), released on 2022-07-24.

DESCRIPTION
    This distributions provides the following command-line utilities:

    *   gid-to-groupname

    *   groupname-to-gid

    *   uid-to-username

    *   username-to-uid

FUNCTIONS
  gid_to_groupname
    Usage:

     gid_to_groupname(%args) -> [$status_code, $reason, $payload, \%result_meta]

    This function is not exported.

    Arguments ('*' denotes required arguments):

    *   group* => *unix::groupname::exists*

    Returns an enveloped result (an array).

    First element ($status_code) is an integer containing HTTP-like status

README  view on Meta::CPAN

    element ($reason) is a string containing error message, or something
    like "OK" if status is 200. Third element ($payload) is the actual
    result, but usually not present when enveloped result is an error
    response ($status_code is not 2xx). Fourth element (%result_meta) is
    called result metadata and is optional, a hash that contains extra
    information, much like how HTTP response headers provide additional
    metadata.

    Return value: (any)

  groupname_to_gid
    Usage:

     groupname_to_gid(%args) -> [$status_code, $reason, $payload, \%result_meta]

    This function is not exported.

    Arguments ('*' denotes required arguments):

    *   group* => *unix::gid::exists*

    Returns an enveloped result (an array).

    First element ($status_code) is an integer containing HTTP-like status
    code (200 means OK, 4xx caller error, 5xx function error). Second
    element ($reason) is a string containing error message, or something
    like "OK" if status is 200. Third element ($payload) is the actual
    result, but usually not present when enveloped result is an error
    response ($status_code is not 2xx). Fourth element (%result_meta) is
    called result metadata and is optional, a hash that contains extra

dist.ini  view on Meta::CPAN

enable_log=1
read_config=0
read_env=0

[GenPericmdScript / GenPericmdScript username-to-uid]
url=/App/UnixUIDUtils/username_to_uid
enable_log=1
read_config=0
read_env=0

[GenPericmdScript / GenPericmdScript gid-to-groupname]
url=/App/UnixUIDUtils/gid_to_groupname
enable_log=1
read_config=0
read_env=0

[GenPericmdScript / GenPericmdScript groupname-to-gid]
url=/App/UnixUIDUtils/groupname_to_gid
enable_log=1
read_config=0
read_env=0

[InsertExecsList]

[@Author::PERLANCAR]
:version=0.606

[Prereqs]

lib/App/UnixUIDUtils.pm  view on Meta::CPAN

use strict;
use warnings;

our %SPEC;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-07-24'; # DATE
our $DIST = 'App-UnixUIDUtils'; # DIST
our $VERSION = '0.002'; # VERSION

$SPEC{gid_to_groupname} = {
    v => 1.1,
    args => {
        group => {
            schema => 'unix::groupname::exists*',
            req => 1,
            pos => 0,
        },
    },
};
sub gid_to_groupname {
    my %args = @_;

    # this function actually just utilizes the coercion rule
    [200, "OK", $args{group}];
}

$SPEC{uid_to_username} = {
    v => 1.1,
    args => {
        user => {

lib/App/UnixUIDUtils.pm  view on Meta::CPAN

        },
    },
};
sub uid_to_username {
    my %args = @_;

    # this function actually just utilizes the coercion rule
    [200, "OK", $args{user}];
}

$SPEC{groupname_to_gid} = {
    v => 1.1,
    args => {
        group => {
            schema => 'unix::gid::exists*',
            req => 1,
            pos => 0,
        },
    },
};
sub groupname_to_gid {
    my %args = @_;

    # this function actually just utilizes the coercion rule
    [200, "OK", $args{group}];
}

$SPEC{username_to_uid} = {
    v => 1.1,
    args => {
        user => {

lib/App/UnixUIDUtils.pm  view on Meta::CPAN

=head1 VERSION

This document describes version 0.002 of App::UnixUIDUtils (from Perl distribution App-UnixUIDUtils), released on 2022-07-24.

=head1 DESCRIPTION

This distributions provides the following command-line utilities:

=over

=item * L<gid-to-groupname>

=item * L<groupname-to-gid>

=item * L<uid-to-username>

=item * L<username-to-uid>

=back

=head1 FUNCTIONS


=head2 gid_to_groupname

Usage:

 gid_to_groupname(%args) -> [$status_code, $reason, $payload, \%result_meta]

This function is not exported.

Arguments ('*' denotes required arguments):

=over 4

=item * B<group>* => I<unix::groupname::exists>


lib/App/UnixUIDUtils.pm  view on Meta::CPAN

(200 means OK, 4xx caller error, 5xx function error). Second element
($reason) is a string containing error message, or something like "OK" if status is
200. Third element ($payload) is the actual result, but usually not present when enveloped result is an error response ($status_code is not 2xx). Fourth
element (%result_meta) is called result metadata and is optional, a hash
that contains extra information, much like how HTTP response headers provide additional metadata.

Return value:  (any)



=head2 groupname_to_gid

Usage:

 groupname_to_gid(%args) -> [$status_code, $reason, $payload, \%result_meta]

This function is not exported.

Arguments ('*' denotes required arguments):

=over 4

=item * B<group>* => I<unix::gid::exists>


=back

Returns an enveloped result (an array).

First element ($status_code) is an integer containing HTTP-like status code
(200 means OK, 4xx caller error, 5xx function error). Second element
($reason) is a string containing error message, or something like "OK" if status is
200. Third element ($payload) is the actual result, but usually not present when enveloped result is an error response ($status_code is not 2xx). Fourth

script/gid-to-groupname  view on Meta::CPAN

#!perl

# Note: This script is a CLI for Riap function /App/UnixUIDUtils/gid_to_groupname
# and generated automatically using Perinci::CmdLine::Gen version 0.501

use 5.010001;
use strict;
use warnings;
use Log::ger;

use Perinci::CmdLine::Any;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-07-24'; # DATE
our $DIST = 'App-UnixUIDUtils'; # DIST
our $VERSION = '0.002'; # VERSION

my $cmdline = Perinci::CmdLine::Any->new(
    url => "/App/UnixUIDUtils/gid_to_groupname",
    program_name => "gid-to-groupname",
    log => 1,
    read_config => 0,
    read_env => 0,
);

$cmdline->run;

# ABSTRACT: gid-to-groupname
# PODNAME: gid-to-groupname

__END__

=pod

=encoding UTF-8

=head1 NAME

gid-to-groupname - gid-to-groupname

=head1 VERSION

This document describes version 0.002 of gid-to-groupname (from Perl distribution App-UnixUIDUtils), released on 2022-07-24.

=head1 SYNOPSIS

% B<gid-to-groupname> [B<--debug>|B<--log-level>=I<level>|B<--quiet>|B<--trace>|B<--verbose>] [B<--format>=I<name>|B<--json>] [B<--(no)naked-res>] [B<--page-result>[=I<program>]|B<--view-result>[=I<program>]] -- E<lt>I<group>E<gt>

=head1 OPTIONS

C<*> marks required options.

=head2 Main options

=over

=item B<--group>=I<s>*

script/gid-to-groupname  view on Meta::CPAN


=head1 COMPLETION

This script has shell tab completion capability with support for several
shells.

=head2 bash

To activate bash completion for this script, put:

 complete -C gid-to-groupname gid-to-groupname

in your bash startup (e.g. F<~/.bashrc>). Your next shell session will then
recognize tab completion for the command. Or, you can also directly execute the
line above in your shell to activate immediately.

It is recommended, however, that you install modules using L<cpanm-shcompgen>
which can activate shell completion for scripts immediately.

=head2 tcsh

To activate tcsh completion for this script, put:

 complete gid-to-groupname 'p/*/`gid-to-groupname`/'

in your tcsh startup (e.g. F<~/.tcshrc>). Your next shell session will then
recognize tab completion for the command. Or, you can also directly execute the
line above in your shell to activate immediately.

It is also recommended to install L<shcompgen> (see above).

=head2 other shells

For fish and zsh, install L<shcompgen> as described above.

script/groupname-to-gid  view on Meta::CPAN

#!perl

# Note: This script is a CLI for Riap function /App/UnixUIDUtils/groupname_to_gid
# and generated automatically using Perinci::CmdLine::Gen version 0.501

use 5.010001;
use strict;
use warnings;
use Log::ger;

use Perinci::CmdLine::Any;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-07-24'; # DATE
our $DIST = 'App-UnixUIDUtils'; # DIST
our $VERSION = '0.002'; # VERSION

my $cmdline = Perinci::CmdLine::Any->new(
    url => "/App/UnixUIDUtils/groupname_to_gid",
    program_name => "groupname-to-gid",
    log => 1,
    read_config => 0,
    read_env => 0,
);

$cmdline->run;

# ABSTRACT: groupname-to-gid
# PODNAME: groupname-to-gid

__END__

=pod

=encoding UTF-8

=head1 NAME

groupname-to-gid - groupname-to-gid

=head1 VERSION

This document describes version 0.002 of groupname-to-gid (from Perl distribution App-UnixUIDUtils), released on 2022-07-24.

=head1 SYNOPSIS

% B<groupname-to-gid> [B<--debug>|B<--log-level>=I<level>|B<--quiet>|B<--trace>|B<--verbose>] [B<--format>=I<name>|B<--json>] [B<--(no)naked-res>] [B<--page-result>[=I<program>]|B<--view-result>[=I<program>]] -- E<lt>I<group>E<gt>

=head1 OPTIONS

C<*> marks required options.

=head2 Main options

=over

=item B<--group>=I<s>*

script/groupname-to-gid  view on Meta::CPAN


=head1 COMPLETION

This script has shell tab completion capability with support for several
shells.

=head2 bash

To activate bash completion for this script, put:

 complete -C groupname-to-gid groupname-to-gid

in your bash startup (e.g. F<~/.bashrc>). Your next shell session will then
recognize tab completion for the command. Or, you can also directly execute the
line above in your shell to activate immediately.

It is recommended, however, that you install modules using L<cpanm-shcompgen>
which can activate shell completion for scripts immediately.

=head2 tcsh

To activate tcsh completion for this script, put:

 complete groupname-to-gid 'p/*/`groupname-to-gid`/'

in your tcsh startup (e.g. F<~/.tcshrc>). Your next shell session will then
recognize tab completion for the command. Or, you can also directly execute the
line above in your shell to activate immediately.

It is also recommended to install L<shcompgen> (see above).

=head2 other shells

For fish and zsh, install L<shcompgen> as described above.

t/00-compile.t  view on Meta::CPAN


use Test::More;

plan tests => 5 + ($ENV{AUTHOR_TESTING} ? 1 : 0);

my @module_files = (
    'App/UnixUIDUtils.pm'
);

my @scripts = (
    'script/gid-to-groupname',
    'script/groupname-to-gid',
    'script/uid-to-username',
    'script/username-to-uid'
);

# no fake home requested

my @switches = (
    -d 'blib' ? '-Mblib' : '-Ilib',
);

t/author-critic.t  view on Meta::CPAN

}


use strict;
use warnings;

# this test was generated with Dist::Zilla::Plugin::Test::Perl::Critic::Subset 3.001.006

use Test::Perl::Critic (-profile => "") x!! -e "";

my $filenames = ['lib/App/UnixUIDUtils.pm','script/gid-to-groupname','script/groupname-to-gid','script/uid-to-username','script/username-to-uid'];
unless ($filenames && @$filenames) {
    $filenames = -d "blib" ? ["blib"] : ["lib"];
}

all_critic_ok(@$filenames);



( run in 1.609 second using v1.01-cache-2.11-cpan-5735350b133 )