Esempio n. 1
0
            public virtual string GetLongUsage()
            {
                TableListing listing = AdminHelper.GetOptionDescriptionListing();

                listing.AddRow("<path>", "The path of the file/directory for getting the storage policy"
                               );
                return(GetShortUsage() + "\n" + "Get the storage policy of a file/directory.\n\n"
                       + listing.ToString());
            }
Esempio n. 2
0
        private void PrintInstanceHelp(TextWriter @out, Command instance)
        {
            @out.WriteLine(instance.GetUsage() + " :");
            TableListing listing = null;
            string       prefix  = "  ";

            foreach (string line in instance.GetDescription().Split("\n"))
            {
                if (line.Matches("^[ \t]*[-<].*$"))
                {
                    string[] segments = line.Split(":");
                    if (segments.Length == 2)
                    {
                        if (listing == null)
                        {
                            listing = CreateOptionTableListing();
                        }
                        listing.AddRow(segments[0].Trim(), segments[1].Trim());
                        continue;
                    }
                }
                // Normal literal description.
                if (listing != null)
                {
                    foreach (string listingLine in listing.ToString().Split("\n"))
                    {
                        @out.WriteLine(prefix + listingLine);
                    }
                    listing = null;
                }
                foreach (string descLine in WordUtils.Wrap(line, MaxLineWidth, "\n", true).Split(
                             "\n"))
                {
                    @out.WriteLine(prefix + descLine);
                }
            }
            if (listing != null)
            {
                foreach (string listingLine in listing.ToString().Split("\n"))
                {
                    @out.WriteLine(prefix + listingLine);
                }
            }
        }
Esempio n. 3
0
            public virtual string GetLongUsage()
            {
                TableListing listing = AdminHelper.GetOptionDescriptionListing();

                listing.AddRow("<path>", "The path of the file/directory to set storage" + " policy"
                               );
                listing.AddRow("<policy>", "The name of the block storage policy");
                return(GetShortUsage() + "\n" + "Set the storage policy to a file/directory.\n\n"
                       + listing.ToString());
            }
Esempio n. 4
0
            public virtual string GetLongUsage()
            {
                TableListing listing = AdminHelper.GetOptionDescriptionListing();

                listing.AddRow("-path <path>", "The path of the cache directives to remove.  " +
                               "You must have write permission on the pool of the directive in order " + "to remove it.  To see a list of cache directives, use the "
                               + "-listDirectives command.");
                return(GetShortUsage() + "\n" + "Remove every cache directive with the specified path.\n\n"
                       + listing.ToString());
            }
Esempio n. 5
0
            public virtual string GetLongUsage()
            {
                TableListing listing = AdminHelper.GetOptionDescriptionListing();

                listing.AddRow("-stats", "Display additional cache pool statistics.");
                listing.AddRow("<name>", "If specified, list only the named cache pool.");
                return(GetShortUsage() + "\n" + WordUtils.Wrap("Display information about one or more cache pools, "
                                                               + "e.g. name, owner, group, permissions, etc.", AdminHelper.MaxLineWidth) + "\n\n"
                       + listing.ToString());
            }
Esempio n. 6
0
            public virtual string GetLongUsage()
            {
                TableListing listing = AdminHelper.GetOptionDescriptionListing();

                listing.AddRow("<id>", "The id of the cache directive to remove.  " + "You must have write permission on the pool of the "
                               + "directive in order to remove it.  To see a list " + "of cache directive IDs, use the -listDirectives command."
                               );
                return(GetShortUsage() + "\n" + "Remove a cache directive.\n\n" + listing.ToString
                           ());
            }
Esempio n. 7
0
            public virtual string GetLongUsage()
            {
                TableListing listing = AdminHelper.GetOptionDescriptionListing();

                listing.AddRow("-stats", "List path-based cache directive statistics.");
                listing.AddRow("<path>", "List only " + "cache directives with this path. " + "Note that if there is a cache directive for <path> "
                               + "in a cache pool that we don't have read access for, it " + "will not be listed."
                               );
                listing.AddRow("<pool>", "List only path cache directives in that pool.");
                listing.AddRow("<id>", "List the cache directive with this id.");
                return(GetShortUsage() + "\n" + "List cache directives.\n\n" + listing.ToString());
            }
Esempio n. 8
0
            public virtual string GetLongUsage()
            {
                TableListing listing = AdminHelper.GetOptionDescriptionListing();

                listing.AddRow("<path>", "A path to cache. The path can be " + "a directory or a file."
                               );
                listing.AddRow("<pool-name>", "The pool to which the directive will be " + "added. You must have write permission on the cache pool "
                               + "in order to add new directives.");
                listing.AddRow("-force", "Skips checking of cache pool resource limits.");
                listing.AddRow("<replication>", "The cache replication factor to use. " + "Defaults to 1."
                               );
                listing.AddRow("<time-to-live>", "How long the directive is " + "valid. Can be specified in minutes, hours, and days, e.g. "
                               + "30m, 4h, 2d. Valid units are [smhd]." + " \"never\" indicates a directive that never expires."
                               + " If unspecified, the directive never expires.");
                return(GetShortUsage() + "\n" + "Add a new cache directive.\n\n" + listing.ToString
                           ());
            }
Esempio n. 9
0
            public virtual string GetLongUsage()
            {
                TableListing listing = AdminHelper.GetOptionDescriptionListing();

                listing.AddRow("<name>", "Name of the new pool.");
                listing.AddRow("<owner>", "Username of the owner of the pool. " + "Defaults to the current user."
                               );
                listing.AddRow("<group>", "Group of the pool. " + "Defaults to the primary group name of the current user."
                               );
                listing.AddRow("<mode>", "UNIX-style permissions for the pool. " + "Permissions are specified in octal, e.g. 0755. "
                               + "By default, this is set to " + string.Format("0%03o", FsPermission.GetCachePoolDefault
                                                                                   ().ToShort()) + ".");
                listing.AddRow("<limit>", "The maximum number of bytes that can be " + "cached by directives in this pool, in aggregate. By default, "
                               + "no limit is set.");
                listing.AddRow("<maxTtl>", "The maximum allowed time-to-live for " + "directives being added to the pool. This can be specified in "
                               + "seconds, minutes, hours, and days, e.g. 120s, 30m, 4h, 2d. " + "Valid units are [smhd]. By default, no maximum is set. "
                               + "A value of \"never\" specifies that there is no limit.");
                return(GetShortUsage() + "\n" + "Add a new cache pool.\n\n" + listing.ToString());
            }
Esempio n. 10
0
            public virtual string GetLongUsage()
            {
                TableListing listing = AdminHelper.GetOptionDescriptionListing();

                listing.AddRow("<name>", "Name of the pool to modify.");
                listing.AddRow("<owner>", "Username of the owner of the pool");
                listing.AddRow("<group>", "Groupname of the group of the pool.");
                listing.AddRow("<mode>", "Unix-style permissions of the pool in octal.");
                listing.AddRow("<limit>", "Maximum number of bytes that can be cached " + "by this pool."
                               );
                listing.AddRow("<maxTtl>", "The maximum allowed time-to-live for " + "directives being added to the pool."
                               );
                return(GetShortUsage() + "\n" + WordUtils.Wrap("Modifies the metadata of an existing cache pool. "
                                                               + "See usage of " + CacheAdmin.AddCachePoolCommand.Name + " for more details.",
                                                               AdminHelper.MaxLineWidth) + "\n\n" + listing.ToString());
            }
Esempio n. 11
0
            public virtual string GetLongUsage()
            {
                TableListing listing = AdminHelper.GetOptionDescriptionListing();

                listing.AddRow("<path>", "The path of the encryption zone to create. " + "It must be an empty directory."
                               );
                listing.AddRow("<keyName>", "Name of the key to use for the " + "encryption zone."
                               );
                return(GetShortUsage() + "\n" + "Create a new encryption zone.\n\n" + listing.ToString
                           ());
            }
Esempio n. 12
0
            public virtual string GetLongUsage()
            {
                TableListing listing = AdminHelper.GetOptionDescriptionListing();

                listing.AddRow("<command-name>", "The command for which to get " + "detailed help. If no command is specified, print detailed help for "
                               + "all commands");
                return(GetShortUsage() + "\n" + "Get detailed help about a command.\n\n" + listing
                       .ToString());
            }