Skip to content

Commit

Permalink
chimera: Add more documentation and error checking to chimera shell
Browse files Browse the repository at this point in the history
Target: trunk
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/6444/
  • Loading branch information
gbehrmann committed Jan 22, 2014
1 parent 39fa0fe commit 804d13a
Showing 1 changed file with 15 additions and 6 deletions.
Expand Up @@ -252,7 +252,9 @@ public Serializable call() throws ChimeraFsException
}
}

@Command(name = "chgrp", hint = "change file group")
@Command(name = "chgrp", hint = "change file group",
usage = "The chgrp command sets the group ID of PATH to GID. Mapped group names " +
"cannot be used.")
public class ChgrpCommand implements Callable<Serializable>
{
@Argument(index = 0)
Expand All @@ -269,7 +271,9 @@ public Serializable call() throws ChimeraFsException
}
}

@Command(name = "chmod", hint = "change file mode")
@Command(name = "chmod", hint = "change file mode",
usage = "The chmod command modifies the file mode bits of PATH to MODE. The MODE must " +
"be expressed as an octal bit mask.")
public class ChmodCommand implements Callable<Serializable>
{
@Argument(index = 0)
Expand All @@ -286,7 +290,9 @@ public Serializable call() throws ChimeraFsException
}
}

@Command(name = "chown", hint = "change file owner and group")
@Command(name = "chown", hint = "change file owner and group",
usage = "The chown command sets the owner of PATH to UID. Mapped user names " +
"cannot be used.")
public class ChownCommand implements Callable<Serializable>
{
@Argument(index = 0, valueSpec = "UID[:GID]")
Expand Down Expand Up @@ -858,7 +864,7 @@ public class ChecksumGetComamnd implements Callable<Serializable>
@Argument(index = 0)
File path;

@Argument(index = 1)
@Argument(index = 1, valueSpec = "adler32|md5_type|md4_type")
ChecksumType type;

@Override
Expand All @@ -882,7 +888,7 @@ public class ChecksumAddCommand implements Callable<Serializable>
@Argument(index = 0)
File path;

@Argument(index = 1)
@Argument(index = 1, valueSpec = "adler32|md5_type|md4_type")
ChecksumType type;

@Argument(index = 2)
Expand All @@ -893,6 +899,9 @@ public Serializable call() throws ChimeraFsException
{
Checksum c = new Checksum(type, checksum);
FsInode inode = lookup(path);
if (inode.isDirectory() || inode.isLink()) {
throw new ChimeraFsException("Not a regular file: " + path);
}
fs.setInodeChecksum(inode, type.getType(), c.getValue());
return null;
}
Expand All @@ -904,7 +913,7 @@ public class ChecksumDeleteCommand implements Callable<Serializable>
@Argument(index = 0)
File path;

@Argument(index = 1)
@Argument(index = 1, valueSpec = "adler32|md5_type|md4_type")
ChecksumType type;

@Override
Expand Down

0 comments on commit 804d13a

Please sign in to comment.