Index: /trunk/DataStore/Changes
===================================================================
--- /trunk/DataStore/Changes	(revision 24373)
+++ /trunk/DataStore/Changes	(revision 24374)
@@ -7,4 +7,5 @@
     - change ds*ls utilties to always return the HTTP status code - 300 as the
       exit status
+    - add --xattr flag to dsget
 
 0.07 Mon May 12 12:04:24 HST 2008
Index: /trunk/DataStore/scripts/dsget
===================================================================
--- /trunk/DataStore/scripts/dsget	(revision 24373)
+++ /trunk/DataStore/scripts/dsget	(revision 24374)
@@ -1,7 +1,5 @@
 #!/usr/bin/env perl
 
-# Copyright (C) 2006-2008  Joshua Hoblitt
-#
-# $Id: dsget,v 1.35 2008-09-24 21:58:03 jhoblitt Exp $
+# Copyright (C) 2006-2009  Joshua Hoblitt
 
 use strict;
@@ -9,5 +7,5 @@
 
 use vars qw( $VERSION );
-$VERSION = '0.02';
+$VERSION = '0.03';
 
 use DataStore;
@@ -28,5 +26,6 @@
     $server,
     $compress,
-    $timeout
+    $timeout,
+    @xattrs,
 );
 
@@ -43,5 +42,6 @@
     'filename|f=s'  => \$filename,
     'compress|c'    => \$compress,
-    'timeout|t=s'     => \$timeout,
+    'timeout|t=s'   => \$timeout,
+    'xattr|x=s'     => \@xattrs,
 ) or pod2usage( 2 );
 
@@ -159,4 +159,6 @@
     require Nebulous::Client;
     import Nebulous::Client;
+    require Nebulous::Util;
+    import Nebulous::Util qw( :standard );
     require File::Copy;
     import File::Copy;
@@ -188,4 +190,9 @@
         or die "Nebulous can't set xattr on key $filename";
 
+    if (scalar @xattrs) {
+        write_xattrs($neb, $filename, @xattrs)
+            or die "Nebulous set xattrs on key $filename";
+    }
+
     open(my $src_fh, $tmpfilename) or die "can't open file $tmpfilename: $!";
 
@@ -230,5 +237,6 @@
 
     dsget --uri <uri> --filename <filename> [--bytes <nbytes>] [--md5 <hex>]
-        [--compress] [--nebulous] [--volume <volume name>] [--copies <n>]
+        [--compress] [--nebulous] [--xattr user.<name>:<value>]
+        [--volume <volume name>] [--copies <n>]
 
 =head1 DESCRIPTION
@@ -265,4 +273,11 @@
 Optional.
 
+=item * --xattr|-x
+
+Flag to set a Nebulous xattr on C<--filename>.  Can be specified more than
+once.
+
+Optional.
+
 =item * --compress|-c
 
@@ -306,5 +321,5 @@
 =head1 COPYRIGHT
 
-Copyright (C) 2006-2008  Joshua Hoblitt.  All rights reserved.
+Copyright (C) 2006-2009  Joshua Hoblitt.  All rights reserved.
 
 This program is free software; you can redistribute it and/or modify it under
Index: /trunk/DataStore/t/07_file.t
===================================================================
--- /trunk/DataStore/t/07_file.t	(revision 24373)
+++ /trunk/DataStore/t/07_file.t	(revision 24374)
@@ -115,5 +115,5 @@
         uri         => "http://localhost:$port/somefile",
         fileid      => '12buckelyourshoe',
-        bytes       => 9,
+        bytes       => 10,
         md5sum      => 'a0a6e1a375117c58d77221f10c5ce12e',
         type        => 'chip',
@@ -129,5 +129,5 @@
         uri         => "http://localhost:$port/somefile",
         fileid      => '12buckelyourshoe',
-        bytes       => 9,
+        bytes       => 10,
         md5sum      => 'a0a6e1a375117c58d77221f10c5ce12e',
         type        => 'chip',
