From 1401a8cad647d3517a4930770af14f09c7b79223 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Fri, 15 Apr 2011 12:28:15 +0000 Subject: clean and reindent the array that contains all options --- iurt_root_command | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'iurt_root_command') diff --git a/iurt_root_command b/iurt_root_command index 57e709e..28c1394 100755 --- a/iurt_root_command +++ b/iurt_root_command @@ -50,8 +50,9 @@ $run{todo} = []; [--mkdir [--parents] ... ]", "$program_name is a perl script to execute commands which need root privilege, it helps probram which needs occasional root privileges for some commands.", sub { $arg or usage($program_name, \@params) }, "Running $program_name" ], + [ "", "cp", [ - ["", "cp", -1, "[-r] ... ", "copy the files to dest", + ["", "cp", -1, "[-r] ... ", "copy the files to dest", sub { my ($tmp, @arg) = @_; $tmp->[0] ||= {}; @@ -64,6 +65,7 @@ $run{todo} = []; ], "[-r] ... ", "Copy files", \&cp, "Copying files" ], + [ "", "ln", [ ["", "ln", 2, " ", "link file1 to file2", sub { @@ -72,12 +74,10 @@ $run{todo} = []; push @$tmp, @arg; 1; }, "Setting ln command arguments"], -# ["r", "recursive", 0, "", -# "Also create needed parents directories", -# sub { my ($tmp) = @_; $tmp->[0]{recursive} = 1; 1 }, "Set the recursive flag"], ], " ", "Link files", \&ln, "Linking files" ], + [ "", "mkdir", [ ["", "mkdir", -1, "[--parents] ... ", "mkdir create the given path", sub { @@ -92,8 +92,9 @@ $run{todo} = []; ], "[--parents] ... ", "mkdir create the given path", \&mkdir, "Creating the path" ], + [ "", "rm", [ - ["", "rm", -1, "[-r] ... ", "remove the provided files", + ["", "rm", -1, "[-r] ... ", "remove the provided files", sub { my ($tmp, @arg) = @_; $tmp->[0] ||= {}; @@ -106,17 +107,21 @@ $run{todo} = []; ], "[-r] ... ", "Remove files", \&rm, "Removing files" ], + [ "", "initdb", 1 , "", "perform a rpm --initdb in the chroot.", \&initdb, "Initializing the rpm database" ], + [ "v", "verbose", 1, "", "modprobe try to modprobe the given module if authorized.", sub { $run{verbose} = $_[0]; 1 }, "Setting verbose level" ], + [ "", "modprobe", 1, "", "modprobe try to modprobe the given module if authorized.", \&modprobe, "Modprobing" ], - [ "", "tar", [ - ["", "tar", 2, " ", "tar directory into file", + + [ "", "tar", [ + ["", "tar", 2, " ", "tar directory into file", sub { my ($tmp, @arg) = @_; $tmp->[0] ||= {}; @@ -126,8 +131,9 @@ $run{todo} = []; ], " ", "Create tarball", \&tar, "Create tarball" ], - [ "", "untar", [ - ["", "untar", -1, " [files]", "untar file into directory (optionally selecting files only)", + + [ "", "untar", [ + ["", "untar", -1, " [files]", "untar file into directory (optionally selecting files only)", sub { my ($tmp, @arg) = @_; $tmp->[0] ||= {}; @@ -137,17 +143,21 @@ $run{todo} = []; ], " [files]", "Uncompress tarball", \&untar, "Uncompress tarball" ], + [ "", "bindmount", 2, " ", "bind mount source on dest", \&bindmount, "Bind mounting" ], + [ "", "umount", 1, "", "umount the given directory", \&umount, "Unmounting" ], + [ "", "useradd", 3, " [uid]", "Add user in given chroot", \&useradd, "Useradd" ], - [ "", "urpmi", [ - ["", "urpmi", -1, "urpmi options", "run urpmi with urpmi options (should have chroot options)", + + [ "", "urpmi", [ + ["", "urpmi", -1, "urpmi options", "run urpmi with urpmi options (should have chroot options)", sub { my ($tmp, @arg) = @_; push @$tmp, @arg; -- cgit v1.2.1