anchor.diff:           {help, $H, "help", boolean, "Show this message"}
           ]).
   
  --define(sort_opt_spec,   [{sort, $s, "sort", undefined, "Determine to sort results instead of streaming list keys"}]).
  +-define(sort_opt_spec,   [{sort, $s, "sort", {boolean, false}, "Sort the results"}]).
   -define(bucket_opt_spec, [{bucket, undefined, undefined, string, "bucket name"}]).
   -define(object_opt_spec, [{object, undefined, undefined, string, "object name"}]).
   
  
positive.code:                end,
      ListFun(RiakcPid, "moss.buckets", PrintFun).
  
  lookup_listbucket_fun(Opts) ->
      case proplists:get_value(sort, Opts) of
          true ->
              fun pb_list_buckets/2;
          _ ->
              fun pb_stream_list_buckets/2
      end.
  
  lookup_listkey_fun(Opts) ->
      case proplists:get_value(sort, Opts) of
          true ->
              fun pb_list_keys/3;
          _ ->
              fun pb_stream_list_keys/3
      end.
  
  % For Backward compatibility. Is this needed?
  list_objects(RiakcPid, Bucket)->
      list_objects(RiakcPid, Bucket, fun pb_list_keys/3).
  
  list_objects(RiakcPid, Bucket, ListFun)->
      print_manifest_summary(pid, bucket, sibling_no, header),
      ManifestBucketName = riak_cs_utils:to_bucket_name(objects, Bucket),
  
negative.code:             [{1, {tombstone, tombstone}}]
      end.
  
  lookup_listbucket_fun(Opts) ->
      case proplists:get_value(sort, Opts) of
          true ->
              fun pb_list_buckets/2;
          _ ->
              fun pb_stream_list_buckets/2
      end.
  
  lookup_listkey_fun(Opts) ->
      case proplists:get_value(sort, Opts) of
          true ->
              fun pb_list_keys/3;
          _ ->
              fun pb_stream_list_keys/3
      end.
  
  pb_list_buckets(RiakcPid, PrintFun) ->
          case riakc_pb_socket:list_buckets(RiakcPid) of
              {ok, Keys} ->
                  PrintFun(lists:sort(Keys));
              Error ->
                  Error
          end.
  
  pb_stream_list_buckets(RiakcPid, PrintFun) ->
          case riakc_pb_socket:stream_list_buckets(RiakcPid) of
              {ok, ReqId} ->
                  print_stream_list(ReqId, PrintFun);
              Error ->
                  error(Error)
          end.
  
  pb_list_keys(RiakcPid, BucketName, PrintFun) ->
  
          case riakc_pb_socket:list_keys(RiakcPid, BucketName) of
              {ok, Keys} ->
                  PrintFun(lists:sort(Keys));
              Error ->
                  Error
          end.
  
  pb_stream_list_keys(RiakcPid, BucketName, PrintFun) ->
          case riakc_pb_socket:stream_list_keys(RiakcPid, BucketName) of
              {ok, ReqId} ->
                  print_stream_list(ReqId, PrintFun);
              Error ->
                  error(Error)
          end.
  
  print_stream_list(ReqId, PrintFun) ->
      receive
          {ReqId, done} ->
              ok;
          {ReqId, {error, Reason}} ->
              error(Reason);
          {ReqId, {_, Res}} ->
              PrintFun(Res),
              print_stream_list(ReqId, PrintFun)
      end.
  
  %% Other utilities
  
  pp(Atom, Value) ->
  