Changeset 17766 for trunk/Nebulous/bin/neb-xattr
- Timestamp:
- May 21, 2008, 3:45:08 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/bin/neb-xattr (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/bin/neb-xattr
r17764 r17766 3 3 # Copyright (C) 2008 Joshua Hoblitt 4 4 # 5 # $Id: neb-xattr,v 1. 2 2008-05-22 01:38:59jhoblitt Exp $5 # $Id: neb-xattr,v 1.3 2008-05-22 01:45:08 jhoblitt Exp $ 6 6 7 7 use strict; … … 48 48 } 49 49 50 # key with xattr .value pair and -w flag means write/overwrite xattr.value50 # key with xattr:value pair and -w flag means write/overwrite xattr:value 51 51 if (defined $write) { 52 die "--write requires a list of name.value pairs" unless scalar @ARGV;52 die "--write requires a list of xattr:value pairs" unless scalar @ARGV; 53 53 write_xattrs($key, @ARGV); 54 54 exit(0); 55 55 } 56 56 57 # key without xattr name list means print all xattr .value pairs57 # key without xattr name list means print all xattr:value pairs 58 58 if (not scalar @ARGV) { 59 59 print_all_xattrs($key); … … 61 61 } 62 62 63 # key with xattr name list means print the xattr .value pairs63 # key with xattr name list means print the xattr:value pairs 64 64 print_xattrs($key, @ARGV); 65 65 exit(0); … … 89 89 foreach my $arg (@xattr_names) { 90 90 my ($name, $value) = parse_xattr_pair($arg); 91 die "can not process $arg because it is in name .value form"91 die "can not process $arg because it is in name:value form" 92 92 if defined $value; 93 93 $value = $neb->getxattr($key, $name) or die $neb->err; 94 print "$name .$value\n";94 print "$name:$value\n"; 95 95 } 96 96 … … 108 108 foreach my $arg (@xattr_pairs) { 109 109 my ($name, $value) = parse_xattr_pair($arg); 110 die "can not process $arg because it is not in name .value form"110 die "can not process $arg because it is not in name:value form" 111 111 unless defined $name and defined $value; 112 112 $neb->setxattr($key, $name, $value, "replace") … … 127 127 foreach my $arg (@xattr_names) { 128 128 my ($name, $value) = parse_xattr_pair($arg); 129 die "can not process $arg because it is in name .value form"129 die "can not process $arg because it is in name:value form" 130 130 if defined $value; 131 131 $neb->removexattr($key, $name) … … 144 144 145 145 no warnings qw( uninitialized ); 146 my ($name, $value) = split(/ \./, $pair);146 my ($name, $value) = split(/:/, $pair); 147 147 use warnings; 148 148
Note:
See TracChangeset
for help on using the changeset viewer.
