Skip to content

Commit

Permalink
Merge pull request #134 from mknos/od-rename-skip-option
Browse files Browse the repository at this point in the history
od: rename option -s to -j
  • Loading branch information
briandfoy committed Mar 11, 2023
2 parents 20afb3b + 616697b commit 566a830
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions bin/od
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ License: perl

use strict;
use Getopt::Std;
use vars qw/ $opt_A $opt_b $opt_c $opt_d $opt_f $opt_i $opt_l $opt_o
$opt_v $opt_x $opt_s /;
use vars qw/ $opt_A $opt_b $opt_c $opt_d $opt_f $opt_i $opt_j $opt_l $opt_o
$opt_v $opt_x /;

my ($offset1, $radix, $data, @arr, $len);
my ($lastline, $upformat, $pffmt, $strfmt, $skip, $ml);
my $retval;
my ($lastline, $upformat, $pffmt, $strfmt, $ml);
local *FH;

my %charescs = (
Expand Down Expand Up @@ -60,14 +59,14 @@ my %charescs = (
$offset1 = 0;
$lastline = '';

getopts('A:bcdfilovxs:') or help();
getopts('A:bcdfij:lovx') or help();
defined $opt_A ? ($radix = $opt_A) : ($radix = 'o');
defined $opt_s && ($offset1 = $opt_s);
defined $opt_j && ($offset1 = $opt_j);

open(FH, '<', $ARGV[0]) || die "Can't open $ARGV[0] for read: $!";

binmode(FH);
seek(FH,$offset1,0);
seek(FH, $offset1, 0) if $offset1;

$opt_o = 1 if ! ($opt_b || $opt_c || $opt_d || $opt_f || $opt_i ||
$opt_l || $opt_o || $opt_x);
Expand Down Expand Up @@ -237,7 +236,7 @@ od - dump files in octal and other formats
=head1 SYNOPSIS
B<od.pl> [ I<-abcdfiloxv> ] [ I<-A radix> ] F<filename>
B<od.pl> [ I<-abcdfiloxv> ] [I<-j skip_n_bytes>] [ I<-A radix> ] F<filename>
=head1 DESCRIPTION
Expand Down

0 comments on commit 566a830

Please sign in to comment.